Created
May 8, 2013 17:14
-
-
Save farmerbradllc/5541967 to your computer and use it in GitHub Desktop.
Main Carousel.vm
This file contains hidden or 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
<script> | |
// Can also be used with $(document).ready() | |
$(window).load(function() { | |
$('.flexslider.carousel-${reserved-article-id.data}').flexslider({ | |
animation: "slide", | |
#if ($loop.data != "") | |
animationLoop: true, | |
#else | |
animationLoop: false, | |
#end | |
start: function(slider){ | |
$('body').removeClass('loading'); | |
if ($(window).width() > 480){ | |
$(window).scroll(function () { | |
//Handel Dockbar Banner Positioning | |
if ($('body').hasClass('dockbar-ready') && window.scrollY < 30){ | |
$('#banner').css('position', 'absolute'); | |
}else { | |
$('#banner').css('position', 'fixed'); | |
} | |
//Handel Banner Class when scrolling past the main carousel | |
if (window.scrollY >= $('#main-carousel .slides li').height() - $('#banner').height()){ | |
$('#banner').addClass('changed'); | |
console.log(window.scrollY); | |
} | |
if (window.scrollY < $('#main-carousel .slides li').height() - $('#banner').height()){ | |
$('#banner').removeClass('changed'); | |
} | |
}); | |
} | |
#if ($autoplay.data == "") | |
$('.flexslider.carousel-${reserved-article-id.data}').flexslider("pause"); | |
#end | |
} | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment