Last active
December 15, 2015 13:09
-
-
Save zaz/5265693 to your computer and use it in GitHub Desktop.
Collection of jQuery scripts.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".email").each(function() { | |
$(this).html( $(this).html().replace("...", "@").replace(/\.\.\./g, ".") ); | |
$(this).attr("href", $(this).attr("href").replace("...", "@").replace(/\.\.\./g, ".") ); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var FADE = 2000; | |
var WAIT = 5000; | |
var FIRST = $("#slider img:first"); | |
function slide(curr) { | |
var next = curr.next("img").length ? curr.next("img") : FIRST; | |
next.css('z-index', 0) && curr.css('z-index', 1); | |
next.fadeIn(0) && curr.fadeOut(FADE); | |
setTimeout(function() { slide(next); }, WAIT); | |
} | |
// Start the slider if there is more than one image: | |
FIRST.next("img").length && setTimeout(function() { slide(FIRST); }, WAIT); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment