Created
March 3, 2009 19:16
-
-
Save mikebranski/73465 to your computer and use it in GitHub Desktop.
Layer One - slider examples
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
$(document).ready(function() { | |
/* | |
* Original | |
*/ | |
$(".sliderContent").addClass("overflowSliderContent"); | |
$(".sliderContent").children().addClass("hiddenSliderContent"); | |
$(".sliderContent").each(function(i) { $($(this).children().get(0)).removeClass("hiddenSliderContent"); }); | |
/* | |
* Chained | |
*/ | |
$(".sliderContent") | |
.addClass("overflowSliderContent") | |
.children() | |
.addClass("hiddenSliderContent") | |
.end() | |
.each( | |
function(i) { | |
//$($(this).children().get(0)).removeClass("hiddenSliderContent"); | |
// Not 100% sure if this'll work, but I think it's faster | |
$( this.children()[0] ).removeClass("hiddenSliderContent"); | |
} | |
); | |
/* | |
* Cached | |
*/ | |
var sliderContent = $(".sliderContent"); | |
sliderContent.addClass("overflowSliderContent"); | |
sliderContent.children().addClass("hiddenSliderContent"); | |
sliderContent.each(function(i) { $($(this).children().get(0)).removeClass("hiddenSliderContent"); }); | |
/* | |
* data method | |
*/ | |
var sliderContent = $(".sliderContent"); | |
sliderContent.addClass("overflowSliderContent"); | |
sliderContent.children().data("state", "hidden"); | |
sliderContent.each(function(i) { $($(this).children().get(0)).data("state", "visible"); }); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment