微小的滚动条出现JavaScript错误(JavaScript error with Tiny Scrollbar)
我将TinyscrollBar添加到我的Wordpress网站,并且在页面加载时出现以下错误:
oViewport.obj[0] is undefined我确信我首先包含了tinyscrollbar.js文件,然后才能打电话
if (jQuery('#execphp-3 div')){ jQuery('#execphp-3 div').tinyscrollbar(); }可能是导致错误的问题是什么?
编辑 :tinyscrollbar运行的HTML:
<li class="widget-container widget_execphp" id="execphp-3"> <h3 class="widget-title">Talking NanoChannels</h3> <div class="execphpwidget"> <div id="scrollbar1"> <div class="scrollbar" style="height: 347px;"> <div class="track" style="height: 347px;"> <div class="thumb" style="top: 90.8106px; height: 256.189px;"> <div class="end"> </div> </div> </div> </div> <div class="viewport"> <div class="overview" style="top: -123px;"> <ul class="wrap masoned" id="simplepie" style="position: relative; height: 683px;"> <li title="" class="box col1" style="position: absolute; left: 0px; top: 0px;"> <h4> <span class="twitter"></span> <a href="http://twitter.com/EreiItamisy/statuses/87518699866701825"> 5th International Conference on Nanochannels, Microchannels, and Minichannels: Puebla, Mexico - June 18-20, 2007: http://amzn.to/jutpBp</a> </h4> <span class="corner"></span> </li> </ul> </div> </div> </div> </div> </li>I added TinyscrollBar to my Wordpress site, and I'm getting the following error when the page loads:
oViewport.obj[0] is undefinedI made sure that I first included the tinyscrollbar.js file, and only then do I make the call
if (jQuery('#execphp-3 div')){ jQuery('#execphp-3 div').tinyscrollbar(); }What could be the problem that's causing the error?
EDIT: The HTML that the tinyscrollbar is running on:
<li class="widget-container widget_execphp" id="execphp-3"> <h3 class="widget-title">Talking NanoChannels</h3> <div class="execphpwidget"> <div id="scrollbar1"> <div class="scrollbar" style="height: 347px;"> <div class="track" style="height: 347px;"> <div class="thumb" style="top: 90.8106px; height: 256.189px;"> <div class="end"> </div> </div> </div> </div> <div class="viewport"> <div class="overview" style="top: -123px;"> <ul class="wrap masoned" id="simplepie" style="position: relative; height: 683px;"> <li title="" class="box col1" style="position: absolute; left: 0px; top: 0px;"> <h4> <span class="twitter"></span> <a href="http://twitter.com/EreiItamisy/statuses/87518699866701825"> 5th International Conference on Nanochannels, Microchannels, and Minichannels: Puebla, Mexico - June 18-20, 2007: http://amzn.to/jutpBp</a> </h4> <span class="corner"></span> </li> </ul> </div> </div> </div> </div> </li>最满意答案
你可能想要这样的东西:
if (jQuery('#execphp-3 div#scrollbar1')) { jQuery('#execphp-3 div#scrollbar1').tinyscrollbar(); }You probably want something like this:
if (jQuery('#execphp-3 div#scrollbar1')) { jQuery('#execphp-3 div#scrollbar1').tinyscrollbar(); }更多推荐
发布评论