微小的滚动条出现JavaScript错误(JavaScript error with Tiny Scrollbar)

编程入门 行业动态 更新时间:2024-10-07 18:25:08
微小的滚动条出现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">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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 undefined

I 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">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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(); }

更多推荐

本文发布于:2023-04-29 10:11:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1335583.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:微小   滚动条   错误   Tiny   Scrollbar

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!