开发者

jQuery cycle: how is wrapper width calculated?

开发者 https://www.devze.com 2023-01-05 12:01 出处:网络
I\'ve implemented a cycle effect like the one seen here. In that demo the plugin adds the following inline css on the div that contains the sliding elements:

I've implemented a cycle effect like the one seen here. In that demo the plugin adds the following inline css on the div that contains the sliding elements:

overflow: hidden; position: relative;

On my page however it adds this css:

overflow: hidden; position: relative; width: 302px; height: 414px;

Because of this, part of the content of the sliding div is obscured / invisible. How does the plugin calculate this width of 302px and how can I alter it?

My test page can be seen here and the issue is that the right gray bord开发者_StackOverflow社区er when mouseovering the center images does not appear in some browsers. It is obscured by the #slider div. I'm making ongoing changes to this so things may look a little weird

EDIT: I managed to fix it with the JS below but am still interested in getting this question answered

$("#slider").css('width', "420px");


I just ran into the same problem. If you just need a fixed width, add the following options to the cycle() call:

width:530,
fit:true
0

精彩评论

暂无评论...
验证码 换一张
取 消