IE8及更低版本中的JQdock问题

时间:2011-07-22 05:25:11

标签: javascript jquery html

我开始使用JQDock,它对我很有用,除了< IE8。在那里,所有图像都以展开状态显示在一起,并且我没有得到翻滚效果。我找不到任何关于此的任何其他信息所以我假设我只是因为它似乎不是一个常见的问题。

这是代码

<script language="javascript" type="text/javascript" src="/Content/thirdparty/jquery/plugins/jqdock/jquery.jqDock.min.js"></script>

<script language="javascript" type="application/javascript">//<![CDATA[
jQuery(document).ready(function ($) {
    var opts =
{ align: 'left',
    bias: 45,
    step: 75,
    size: 55, flow: true
};
    jQuery('#dock').jqDock(opts);
});
//]]>
</script>


<style>
#dock { background: #333 url("/Content/i/dock/pattern.png") repeat top left; width: 72px; border-right: 2px solid #d5d7d7; margin-left: -5px;padding: 0; }
#dock a { font-size: 11px; color: #fbfbf1; border:0; text-decoration: none; }
#dock div.jqDockWrap{ margin:0 auto; }
#dock div.jqDock { cursor:pointer; }
#dock img { padding: 8px 10px; }
#dockWrapper { float:left; width:100px; padding:0; margin:15px 0 0 -5px; }
.corners { margin-left: -11px;padding: 0;margin-bottom:-5px; }
</style>

<div id="dockWrapper" >
<div class="corners"><img src="/Content/i/dock/top.png" width="80" height="15"/>            </div>
<div id="dock">
    <a href="link1" title="Desk"><img src="/Content/i/dock/image1.png" alt="title" title="title" height="80" width="80" /></a>
    <a href="link2" title="title"><img src="/Content/i/dock/image2.png" alt="title" title="title" /></a>
    <a href="link3" title="title"><img src="/Content/i/dock/image3.png" alt="title" title="title" /></a>
    <a href="link4" title="title"><img src="/Content/i/dock/image4.png" alt="title" title="title" /></a>
<!-- others removed for brevity -->
</div>
<div class="corners"><img src="/Content/i/dock/bottom.png" width="80" height="15" /></div>

对此问题的任何想法都会有所帮助。

由于

1 个答案:

答案 0 :(得分:0)

我想您忘了关闭<div id="dockWrapper" >尝试添加</div>

<div id="dockWrapper" >
<div class="corners"><img src="/Content/i/dock/top.png" width="80" height="15"/>            </div>
<div id="dock">
    <a href="link1" title="Desk"><img src="/Content/i/dock/image1.png" alt="title" title="title" height="80" width="80" /></a>
    <a href="link2" title="title"><img src="/Content/i/dock/image2.png" alt="title" title="title" /></a>
    <a href="link3" title="title"><img src="/Content/i/dock/image3.png" alt="title" title="title" /></a>
    <a href="link4" title="title"><img src="/Content/i/dock/image4.png" alt="title" title="title" /></a>
<!-- others removed for brevity -->
</div>
<div class="corners"><img src="/Content/i/dock/bottom.png" width="80" height="15" /></div>
</div>

更新

你宣布了doctype

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">