Skip to content

Instantly share code, notes, and snippets.

@tacamy
Last active August 29, 2015 14:23
Show Gist options
  • Save tacamy/e9a5bdbabeb0b8227310 to your computer and use it in GitHub Desktop.
Save tacamy/e9a5bdbabeb0b8227310 to your computer and use it in GitHub Desktop.
flipsnap.jsの幅100%対応 with jQuery
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