Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/jquery.cycle2.carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ $.fn.cycle.transitions.carousel = {
var prepareDimensions = this.prepareDimensions;

// throttle resize event
$(window).on( 'resize', resizeThrottle);
$(window).on( 'load resize', resizeThrottle);

opts._carouselResizeThrottle = resizeThrottle;
onResize();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed to prevent onResize from being called twice. It will be called on window.load so we no longer need it here.

Expand All @@ -156,7 +156,6 @@ $.fn.cycle.transitions.carousel = {
function onResize() {
opts._carouselWrap.stop( false, true );
var slideWidth = opts.container.width() / opts.carouselVisible;
slideWidth = Math.ceil( slideWidth - adjustment );
opts._carouselWrap.children().width( slideWidth );
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree with removing the rounding. In the stuff I am doing, removing this rounding, causes images to shift pixels. While it might work for most use cases there are some instances that still cause problems.

if ( opts._sentinel )
opts._sentinel.width( slideWidth );
Expand Down