2011-10-27 19 views
0

我试图使用JScrollPane的用于在动态DIV滚动,但我有一些麻烦......JQuery的 - JScrollPane中 - 动态高度保持固定

这里是我的结构

<div id="DynamicDivHeightAndWidth"> 
    <div id="Content"> 
     <div id="TextContent"></div> 
    </div> 
</div> 

我只有这个CSS propreties(仅适用于主要的div必须有一个动态的高度和宽度动态)

.DynamicDivHeightAndWidth{ 
color:#FFF; 
float:left; 
margin-left:30px; 
-webkit-border-radius:20px; 
-moz-border-radius:20px; 
background-color:#000; 
border:solid #FF6C00 3px; 
display:none; 
z-index:10; 
overflow:hidden; 
width:21%; 
height:21%;} 

我JScrollPane的声明像这样:

$(function() 
     { 
      $('#Content').each(
       function() 
       { 
        $(this).jScrollPane(
         { 
          showArrows: $(this).is('.arrow') 
         } 
        ); 
        var api = $(this).data('jsp'); 
        var throttleTimeout; 
        $(window).bind(
         'resize', 
         function() 
         { 
          if ($.browser.msie) { 
           // IE fires multiple resize events while you are dragging the browser window which 
           // causes it to crash if you try to update the scrollpane on every one. So we need 
           // to throttle it to fire a maximum of once every 50 milliseconds... 
           if (!throttleTimeout) { 
            throttleTimeout = setTimeout(
             function() 
             { 
              api.reinitialise(); 
              throttleTimeout = null; 
             }, 
             50 
            ); 
           } 
          } else { 
           api.reinitialise(); 
          } 
         } 
        ); 
       } 
      ) 

     }); 

现在我的问题是,我的“DynamicDivHeightAndWidth”有一个动态宽度,但高度停留在修复中,我不知道为什么?

我已经尝试了许多问题,但仍然无法正常工作......

感谢您的帮助^^

回答

0

已经设置您的html和身体的高度,以100% 也只是检查你定义你的动态div作为一个类,而不是一个ID

+0

是的:(但不工作whith或没有:-( – Tidus

+0

http://jsfiddle.net/Diezel23/A4Jkd/5/ –

+0

* div有一个ID,这是类名:-)我忘记之前更改它张贴对不起:-) – Tidus