Home > Web Front-end > JS Tutorial > body text

Mouse over the js code that implements lazy loading and hides the layer_javascript skills

WBOY
Release: 2016-05-16 17:20:20
Original
1169 people have browsed it
Copy code The code is as follows:


< a href="#" onmouseover="showPlusMobile();" onmouseout="hidePlusMobile();" class="btn"> Follow

This is the hidden layer





css:
Copy code The code is as follows:

. layer_follow
{
display:none
}

js:
Copy code The code is as follows:

var isPlusMobileVisible=false;
var showTid;
var hideTid;
function showPlusMobile(){
if(isPlusMobileVisible == false) {
showTid = setTimeout("document.getElementById('layer_follow').style.display='block'; isPlusMobileVisible=true;", 500);
}else{
clearTimeout(hideTid);
}
}
function hidePlusMobile(){
if(isPlusMobileVisible == true) {
hideTid = setTimeout("document.getElementById('layer_follow').style.display='none'; isPlusMobileVisible=false;", 500);
}else {
clearTimeout(showTid);
}
}
Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!