开发者

Unable to use jquery scrollto plugin - getting error "targ is undefined..."

开发者 https://www.devze.com 2023-04-08 00:41 出处:网络
I am using jquery 1.3.2 in my project. I selected the 1.3.x option from the scrollto download page ->

I am using jquery 1.3.2 in my project. I selected the 1.3.x option from the scrollto download page ->

http://plugins.jquery.com/node/635/release?api_version[]=1266 and tried with both the available options there -

ScrollTo 1.4.2 and ScrollTo 1.4.1.

but I am getting t开发者_StackOverflowhis error in both cases.

Here is the code part -

<script type="text/javascript">
$(document).ready(function()
{

if($('tr#manager-'+agencyId).length)>0)
    $('tr#manager-'+agencyId).scrollTo();
});
</script>
<script type="text/javascript" src="/js/jquery.scrollTo.js"></script>

But I am getting this error in firefox ->

targ is undefined
attr[key] = targ[pos];  (jquery.scrollto line 157)

And in IE 8 ->

Message: 'targ' is null or not an object
Line: 157
Char: 6
Code: 0
URI: http://localhost:9001/js/jquery.scrollTo.js

The error appears only on calling .scrollTo().

Anybody faced this issue. What else do I need to check? Any pointers? Thanks.


You should provide a target that the plugin can scroll to.


if($('tr#manager-'+agencyId).length)>0)

there's an extra bracket after length.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号