<script >
$(".ceshi").click(function(){
$(this).css("color","#CCC");
var id=$(this).attr("id");
$(this).addClass("noclick");
var href = $(this).attr("target_href");console.log(href);
window.location.href=href;
setTimeout(function(){
$("#"+id).css("color","#fff");
$("#"+id).removeClass("noclick");
},3000)
})
</script>
<style type="text/css">
.noclick{pointer-events: none;cursor: not-allowed;}
</style>
这篇博客探讨了如何使用JavaScript实现元素点击事件,当元素被点击时改变其颜色并添加noclick类,阻止进一步交互。同时,通过setTimeout在3秒后恢复元素的原始样式。内容涉及到DOM操作、事件监听及页面状态的临时修改。
2444

被折叠的 条评论
为什么被折叠?



