Created
October 25, 2018 12:50
-
-
Save hmmhmmhm/4b159b718c70043ac29a9179fb08fa9f to your computer and use it in GitHub Desktop.
WaterwheelCarousel Resize
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
<script type="text/javascript"> | |
$(document).ready(function () { | |
var carousel = $("#carousel").waterwheelCarousel({ | |
autoPlay : 0, | |
flankingItems:2, | |
movedToCenter: function ($item) { | |
$('#callback-output').prepend('movedToCenter: ' + $item.attr('id') + '<br/>'); | |
$item.siblings("span").css("display","block"); | |
}, | |
movingFromCenter: function ($item) { | |
$('#callback-output').prepend('movingFromCenter: ' + $item.attr('id') + '<br/>'); | |
$item.siblings("span").css("display","none"); | |
} | |
}); | |
var carouselElm = document.getElementById('carousel') | |
$(window).resize(function() { | |
carouselElm.style.width= window.innerWidth+"px"; | |
carouselElm.style.height= (window.innerHeight/3.2)+"px"; | |
carousel.reload({ | |
forcedImageWidth: window.innerWidth/3, | |
forcedImageHeight: (window.innerWidth/3)/1.5, | |
separation: window.innerWidth/6 | |
}); | |
}); | |
}); | |
</script> |
Author
hmmhmmhm
commented
Oct 25, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment