admin管理员组文章数量:1025489
I have a little animation which i want to show thats why i want to delay a link. Help would be nice.
echo '<td><a href="Detail.php?id='.$row["id"].'" onclick="Splash()"></a></td>';
js:
<script>
function Splash()
{
setTimeout( function()
{
}, 2000);
}
</script>
I have a little animation which i want to show thats why i want to delay a link. Help would be nice.
echo '<td><a href="Detail.php?id='.$row["id"].'" onclick="Splash()"></a></td>';
js:
<script>
function Splash()
{
setTimeout( function()
{
}, 2000);
}
</script>
Share
Improve this question
asked Mar 14, 2014 at 15:36
user3400389user3400389
3671 gold badge6 silver badges21 bronze badges
1
-
could you please include your plete code? You might want to look in to
promise()
. api.jquery./promise – timo Commented Mar 14, 2014 at 15:37
1 Answer
Reset to default 6Change it to
echo '<td><a href="Detail.php?id='.$row["id"].'" id="spashlink"></a></td>';
and add a script
$(function() {
$('#spashlink').on('click', function(e) {
e.preventDefault();
var self = this;
setTimeout(function() {
window.location.href = self.href;
}, 2000);
});
});
I have a little animation which i want to show thats why i want to delay a link. Help would be nice.
echo '<td><a href="Detail.php?id='.$row["id"].'" onclick="Splash()"></a></td>';
js:
<script>
function Splash()
{
setTimeout( function()
{
}, 2000);
}
</script>
I have a little animation which i want to show thats why i want to delay a link. Help would be nice.
echo '<td><a href="Detail.php?id='.$row["id"].'" onclick="Splash()"></a></td>';
js:
<script>
function Splash()
{
setTimeout( function()
{
}, 2000);
}
</script>
Share
Improve this question
asked Mar 14, 2014 at 15:36
user3400389user3400389
3671 gold badge6 silver badges21 bronze badges
1
-
could you please include your plete code? You might want to look in to
promise()
. api.jquery./promise – timo Commented Mar 14, 2014 at 15:37
1 Answer
Reset to default 6Change it to
echo '<td><a href="Detail.php?id='.$row["id"].'" id="spashlink"></a></td>';
and add a script
$(function() {
$('#spashlink').on('click', function(e) {
e.preventDefault();
var self = this;
setTimeout(function() {
window.location.href = self.href;
}, 2000);
});
});
本文标签: javascriptDelay a href link for some secondsStack Overflow
版权声明:本文标题:javascript - Delay a href link for some seconds - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745626455a2159891.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论