简体   繁体   English

使用Orbit Jquery插件计算的Div大小错误

[英]Div size miscalculating using Orbit Jquery Plugin

i am using the jquery plugin Orbit and it works fine in FF. 我正在使用jquery插件Orbit,它在FF中工作正常。 in chrome and safari it miscalculates the div size as 1px high and wide and applies it to the wrapper div.. so no photos show up. 在chrome和safari中,它会错误地将div大小计算为1px高和1px,并将其应用于包装器div ..因此没有照片出现。

is there something specific about the rendering engines that make it calculate correctly in one browser but not in another? 渲染引擎是否有特定的特征,可以使它在一个浏览器中正确计算,而在另一个浏览器中却不能正确计算? I have set the style of the wrapper div in my stylesheet, but Orbit applies the style inline which overrides. 我已经在样式表中设置了wrapper div的样式,但是Orbit会应用覆盖的样式内联。

any suggestions would be appreciated. 任何建议,将不胜感激。 i have it running correctly here http://jsfiddle.net/j9zLe/ in all browsers, but the page i am using it on has a lot of other code on it. 我在所有浏览器中的http://jsfiddle.net/j9zLe/上都能正常运行,但是我在其上使用的页面上还有很多其他代码。 i think it must be some style further up the chain... but not sure what to look for. 我认为这一定是某种风格,但是不确定要寻找什么。

thanks Liz 谢谢丽兹

In the jquery.orbit-1.2.3.js file on line 52 is the following line: 在第52行的jquery.orbit-1.2.3.js文件中,以下行:

orbit.add(orbitWidth).width('1px').height('1px');

I'm not sure of the point of this line however if you change the width and height values to the values for your slides or comment-out the line I'm fairly sure it will fix your problem. 我不确定这条线的要点,但是,如果您将宽度和高度值更改为幻灯片的值或注释掉该行,我很确定它将解决您的问题。

In your jsfiddle you need to add a resource for the JavaScript and CSS files for Orbit to make it render properly. 在您的jsfiddle中,您需要为Orbit添加JavaScript和CSS文件的资源,以使其正确呈现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM