var width = $("#carousel-2").width(); $("#carousel-2 img").width(width*.4); var carousel2 = $("#carousel-2").flipster({ style: 'carousel', spacing: -0.4, nav: true, buttons: false });