<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ptml xmlns = "http://www.w3.org/1999/xhtml"> <pead> <style type = "text/ css "> # div1 {width: 304px; height: 222px; position: relative; margin: 30px auto 0px;} # div1 img {width: 304px; height: 222px;} # div1 span {width: 100px; height: 100px; background: red; left: 0px; top: 0px; position: absolute; display: none; filter: alpha (opacity: 20); opacity: 0.2 ;}. show {width: 100%; height: 100%; background: red; position: absolute; z-index: 10px; filter: alpha (opacity: 10); opacity: 0.1; left: 0px; top: 0px; }# div2 {width: 304px; height: 222px; position: relative; display: none; overflow: hidden; margin: 0px auto 0px ;} # img1 {position: absolute ;}</style> <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312 "/> <title> JavaScript image amplification Code </title> </pead> <body> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]