我的(cms)网站上有一个滑块导航,该导航中的链接需要在1秒后加载URL。
导航现在看起来像这样:
<div class="slides">
<div class="slideItem"><a href="page1.html">link1</a></div>
<div class="slideItem"><a href="page2.html">link2</a></div>
<div class="slideItem"><a href="page3.html">link3</a></div>
</div>
我发现下面的脚本可以用于href吗? (如果这样的话)。
setTimeout( "window.location.href = 'http://domain.com/url.html'", 5*1000 );
答案 0 :(得分:0)
这将在5秒后将用户重定向到http://domain.com/url.html
setTimeout( "window.location.href = 'http://domain.com/url.html'", 5*1000 );
如果你想要1秒延迟使用1000作为第二个参数, 你有没有看过这个剧本? 你想要实现什么?