加载另一个html页面并滚动到内页div

时间:2020-06-25 09:19:58

标签: javascript html jquery

我有主索引页面,该页面使用jquery加载方法加载其容器中的所有页面。 现在,类似地加载另一个名为aboutus.html的页面,并为其垂直div设置动画。

我得到的未捕获类型错误偏移量顶部未定义。

代码是用app.js编写的,并链接到index.js

App.js代码: 内部document.ready

Var el= $("#secid"); // on console it returns object object

$("body, html").animate({
 scrollTop: el.offset().top //here top returns error
},2000);```

Thus navigation on inner page not works so what will be the solution on it



 

0 个答案:

没有答案