简体   繁体   English

在IE中使用JQuery Sparkline的问题

[英]Issue with JQuery Sparkline in IE

I used jQuery sparkline ( http://omnipotent.net/jquery.sparkline/ ) in a page. 我在一个页面中使用了jQuery sparkline( http://omnipotent.net/jquery.sparkline/ )。 This gives me problem in IE if the container DIV is not big enough to show it, tried with Firefox/Chrome, it is working fine. 这给我在IE中的问题,如果容器DIV不够大,无法显示它,尝试使用Firefox / Chrome,它运行正常。 See the sample code, 请参阅示例代码,

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
    "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <script type="text/javascript" src="jquery-1.3.1.js"></script>
    <script type="text/javascript" src="jquery.sparkline.min.js"></script>
    <script type="text/javascript">
    $(function() {
        var myvalues = [10,8,5,7,4,4,1];
        $('.dynamicsparkline').sparkline(myvalues, {height:'100px',width:'300px'});
    });
    </script>
</head>
<body>
<div style="height:100px;width:400px;overflow:auto;border:1px solid black">
          Testing Header
          <br/>
          <span class="dynamicsparkline">Loading..</span>
          <br/>
          Testing Footer
</body>
</html>

Can anyone help me here? 有人能帮我一下吗?

Thanks, Manoj 谢谢,Manoj

Gareth Watts( http://omnipotent.net/jquery.sparkline/ ) helped me to solve this issue by adding "position:relative" to the container div. Gareth Watts( http://omnipotent.net/jquery.sparkline/ )通过在容器div中添加“position:relative”帮助我解决了这个问题。

here is the code 这是代码

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
    "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <script type="text/javascript" src="jquery-1.3.1.js"></script>
    <script type="text/javascript" src="jquery.sparkline.min.js"></script>
    <script type="text/javascript">
    $(function() {
        var myvalues = [10,8,5,7,4,4,1];
        $('.dynamicsparkline').sparkline(myvalues, {height:'100px',width:'300px'});
    });
    </script>
</head>
<body>
<div style="height:100px;width:400px;overflow:auto;border:1px solid black;position: relative">
          Testing Header
          <br/>
          <span class="dynamicsparkline">Loading..</span>
          <br/>
          Testing Footer
</div>
</body>
</html>

It can be reproduced only in IE7. 它只能在IE7中复制。

Thanks 谢谢

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

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