【发布时间】:2017-10-09 20:02:12
【问题描述】:
我使用的是1.4.13版本的插件,我也确保页面已经成功加载了插件。
它曾经在我的网站上运行良好,但现在它似乎什么也没做。我正在使用以下代码来运行它:
HTML:
<span class="button-project-info">
<a class="button button-04" href="#project-info">Project Info</a>
</span>
CSS:
$('.button-project-info a').bind('click', function(e) {
try {
e.preventDefault();
target = this.hash;
$('html, body').scrollTo(target, 150);
} catch (error) {
alert('error - ' + error);
}
});
我也尝试了以下方法,点击链接时alert 语句运行良好:
$('.button-project-info a').bind('click', function(e) {
alert('0000');
});
【问题讨论】:
标签: javascript jquery html scroll scrollto