【发布时间】:2014-02-07 04:36:19
【问题描述】:
我正在使用下面链接的插件作为投资组合。您单击一个缩略图,它会展开一个 div 以显示内容,这会将其下方的所有缩略图向下推。这在现代浏览器中运行良好,但我必须支持 IE8。该插件声称支持它,但在 IE8 中,缩略图的底部行没有被向下推。
http://plugins.gravitysign.com/colio/index_black.html
我怀疑它与位置有关:绝对。为了向下推底部缩略图,脚本会根据展开的 div 的高度动态更改每个 li 上的 top:xxx 位置。但是这个位置没有得到适当的改变或在 IE8 中没有得到尊重。
这里是 colio 插件的源代码:http://plugins.gravitysign.com/colio/js/jquery.colio.js
这似乎是 jquery.colio.js 代码中的相关部分(我认为?):
// variables
var duration = this.settings.expandDuration,
easing = this.settings.expandEasing;
// get content_id for item to get viewport height to make a gap in item grid
var content_id = item.data('colio-content-id');
var viewport_height = this.getViewportHeight(content_id);
// add any bottom margins to colio viewport height
viewport_height += parseFloat(this.markup.css('margin-bottom'));
// push items that are below colio viewport down by the amount of viewport height
$.each(this.insideBottomItems(item), function(){
// save initial top position
var item_top = $(this).data('colio-item-top');
if(item_top === undefined) {
item_top = parseFloat($(this).css('top')) || 0;
$(this).data('colio-item-top', item_top);
}
// add class to items that we have pushed down
$(this).addClass('colio-bottom-item');
// push items using animation
$(this).stop().animate({top: item_top + viewport_height}, duration, easing);
});
有人知道这个问题的解决方法吗?
谢谢!
【问题讨论】:
-
我们无法看到您正在使用的代码。
-
对不起,我指的是我上面链接的演示。我将直接链接到源代码并编辑我的帖子。感谢您的提醒。
-
在 Windows 7 虚拟机中,IE10 运行 IE8 渲染模式,我没有看到任何问题:d.pr/i/tzUy
-
当您在第一行的任何缩略图中单击“查看项目”时,您是否看到第二行被推下?在我的 Windows 7 IE8 测试中,第二行从不向下推为展开的 div 腾出空间。
标签: jquery css internet-explorer-8 cross-browser