Skip to content

Instantly share code, notes, and snippets.

@zaz
Last active December 15, 2015 13:09
Show Gist options
  • Save zaz/5265693 to your computer and use it in GitHub Desktop.
Save zaz/5265693 to your computer and use it in GitHub Desktop.
Collection of jQuery scripts.
$(".email").each(function() {
$(this).html( $(this).html().replace("...", "@").replace(/\.\.\./g, ".") );
$(this).attr("href", $(this).attr("href").replace("...", "@").replace(/\.\.\./g, ".") );
});
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