woocommerce / FlexSlider

An awesome, fully responsive jQuery slider plugin
http://www.woocommerce.com/flexslider/
GNU General Public License v2.0
4.92k stars 1.69k forks source link

itemWidth dones't work if Modernizr is included? #1357

Open gvinson opened 9 years ago

gvinson commented 9 years ago

I am having a problem where if I include modernizr (before or after initializing the slider), the itemWidth is ignored until I resize the window. If I set the animation to fade instead of slide, the bug does not occur.

Here is the code I'm using:

$(document).ready(function() {

// #carousel is the nav for #slider
$('#carousel').flexslider({
    animation: "slide",
    controlNav: false,
    animationLoop: true,
    slideshow: false,
    itemWidth: 210,
    itemMargin:5,
    asNavFor: '#slider'
  });

// Main slider
$('#slider').flexslider({
    animation: "slide",
    controlNav: false,
    animationLoop: false,
    slideshow: false,
    sync: "#carousel",
    itemWidth: 672,
    minItems: 1,
    maxItems: 1
  });
});

Anyone else experiencing this?

MarcGuay commented 3 months ago

Set box-sizing: content-box on the slide element to fix this issue.