Skip to content

Instantly share code, notes, and snippets.

@bMinaise
Created October 15, 2013 01:00
Show Gist options
  • Save bMinaise/6984958 to your computer and use it in GitHub Desktop.
Save bMinaise/6984958 to your computer and use it in GitHub Desktop.
Background Change - Visible Script
// jQuery isVisible script - bg color swap
var win = $(window);
var allMods = $(".featurette");
allMods.each(function(i, el) {
var el = $(el);
if (el.visible(false, true)) {
//el.addClass("colorize");
}
});
win.scroll(function(event) {
allMods.each(function(i, el) {
var el = $(el);
if (!el.visible(false,true)) {
//el.css({ "background": "transparent"});
//el.removeClass("colorize");
}
if (el.visible(false, true)) {
//el.css({ "background" : "#863336" , "color" : "#000000" });
//el.addClass("colorize");
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment