JavaScript realizes the closing of ads and display effect instance

  • 2020-06-22 23:53:52
  • OfStack

The example of JavaScript shows how to close and display ads. Share to everybody for everybody reference. Specific implementation methods are as follows:

The js code section is as follows:


<script language="javascript"> 
<!-- 
function display(){ 
if(googlead.style.visibility == 'visible'){ 
googlead.style.visibility ='hidden' ; 
document.getElementById('words').innerHTML=' Shut down '; 
return true; 
} 
else{ 
googlead.style.visibility='visible'; 
document.getElementById('words').innerHTML=' According to '; 
return false; 
} 
} 
//--> 
</script> 

Section html is as follows:


<div id="googlead" style="margin-bottom:5px;width:728px;height:90px;float:left;visibility:visible"> Exchange advertisement ...</div> 
<div id="myid" ><span id="words" onclick="return display()"> Shut down </span></div> 

Hopefully, this article has helped you with your javascript programming.


Related articles: