Home > Web Front-end > JS Tutorial > JavaScript skills_Dragable window, with mouse control of gradient transparency, open and close functions

JavaScript skills_Dragable window, with mouse control of gradient transparency, open and close functions

PHP中文网
Release: 2016-05-16 19:28:47
Original
1166 people have browsed it


<script><br><!--<br/>// code by windy_sk<br/>var timer=null;<br/>var org_opacity=30;<br/>var step=5;<br/>var ext_time=30;</p><p>function doit(img,mode){<br/>  clearTimeout(timer);<br/>  if(img.style.filter.indexOf("alpha")==-1)img.style.filter ="alpha(opacity=" org_opacity ")";<br/>  var cur_level=img.filters.alpha.opacity;<br/>  if(mode){<br/>    cur_level =step;<br/>    if(cur_level>100)cur_level=100;<br>  }else{<br>    cur_level-=step;<br>    if(cur_level<org_opacity)cur_level=org_opacity;<br/>  }<br/>  img.filters.alpha.opacity=cur_level;<br/>  if(cur_level!=100 && cur_level!==ext_time)<br/>    timer=setTimeout("doit(" img.id "," mode ")",ext_time)<br/>}</p><p>function MM_showHideLayers() { //v6.0<br/>  var i,p,v,obj,args=MM_showHideLayers.arguments;<br/>  for (i=0; i<(args.length-2); i =3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i 2];<br/>    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }<br/>    obj.visibility=v; }<br/>}<br/>//--><br></script>



 

 

 

 


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
Latest Articles by Author
Latest Issues
What are JavaScript hook functions?
From 1970-01-01 08:00:00
0
0
0
What is JavaScript garbage collection?
From 1970-01-01 08:00:00
0
0
0
c++ calls javascript
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template