Home > Web Front-end > HTML Tutorial > html中的click事件被触发两次如何解决_html/css_WEB-ITnose

html中的click事件被触发两次如何解决_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:11:51
Original
1684 people have browsed it

//1:用中间变量处理
var b=true;
function(){
if(b){
b=false;
//…你的代码块
}
}
//2用jq处理:
$(“#btnbgm”).one(“click”,function(){
_click($(this));
});
function _click(obj){
//你的代码块
settimeOut(function(){
$(“#btnbgm”).one(“click”,function(){
_click(obj);
});
},500);
}

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template