Last active
August 29, 2015 14:23
-
-
Save tacamy/e9a5bdbabeb0b8227310 to your computer and use it in GitHub Desktop.
flipsnap.jsの幅100%対応 with jQuery
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
var $window = $(window); | |
var $items = $('.items'); | |
var $item = $items.find('.item'); | |
var length = $item.length; | |
setItemSize(); | |
var flipsnap = Flipsnap('.items'); | |
$window.on('resize', function () { | |
setItemSize(); | |
flipsnap.currentX = window.innerWidth * flipsnap.currentPoint; | |
flipsnap.refresh(); | |
}); | |
function setItemSize() { | |
$items.width(window.innerWidth * length); | |
$item.width(window.innerWidth); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment