Bagaimana cara kerjanya: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Ketat//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <kepala> <meta http-equiv="Jenis Konten" content="teks/html; charset=utf-8" /> <judul>www.webjx.com</title> <bahasa skrip=JavaScript1.2> <!-- fungsi tinggi(yang2){ objek=yang mana2 highlighting=setInterval("highlightit(objek)",40) } fungsi rendah(yang2){ clearInterval (menyorot) yang2.filter.alpha.opacity=40 } fungsi highlightit(cur2){ if (cur2.filters.alpha.opacity<100) cur2.filters.alpha.opacity+=5 else if (jendela.highlighting) clearInterval (menyorot) } //--> </skrip> <gaya tipe="teks/css"> <!-- h1 {perataan teks:tengah;margin-atas:50px;} p#luar { margin:0 otomatis; lebar:202 piksel; } #luar a { margin:0 piksel; tampilan:blok; posisi: relatif; batas:1px padat #ccc; } #outer a:hover {border:1px putus-putus #c00;} #gambar luar {display:block;border:none;background:#069;} --> </gaya> </kepala> <tubuh> <h1>将鼠标移至图片,将看到此效果。</h1> <p id="outer"><a href="http://www.webjx.com/"><img onMouseOut=low(ini) onMouseOver=high(this) style='FILTER: alpha(opacity=20) ' src="/u/info_img/2009-05/30/logo.gif" alt="www.webjx.com" width="200" height="90" /></a> </p> </tubuh> </html> |