修改別人的模板遇到一個問題,分類圖的切換預設是五個,我想增加四個,一直沒有增加成功。它使用的onmouseover 事件。
onmouseover怎麼用?
去查了一下:
onmouseover 事件會在滑鼠指標移動到指定的物件上時發生。
onmouseover="SomeJavaScriptCode"
參數 | #描述 |
---|---|
SomeJavaScriptCode |
##必需。規定該事件發生時執行的 JavaScript。
支援該事件的HTML 標籤:<a>, <address>, <area>, <b>, <bdo>, <big>, <blockquote>, <body>, <button>, <caption>, <cite>, <code>, <dd>, <dfn>, <p>, <dl>, <dt>, <em>, <fieldset>, <form>, <h1> to <h6>, <hr>, <i>, <img>, <input>, <kbd>, <label>, <legend>, <li>, <map>, <ol>, <p>, <pre class="brush:php;toolbar:false">, <samp>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <table>, <tbody>, <td>, <textarea>, <tfoot>, <th>, <thead>, <tr>, <tt>, <ul>, <var>
layer, link
<img src="/i/eg_mouse2.jpg" alt="mouse"onmouseover="alert('您的鼠标在图片上!')" />
<html> <head> <script type="text/javascript"> function mouseOver() { document.getElementById('b1').src ="/i/eg_mouse.jpg" } function mouseOut() { document.getElementById('b1').src ="/i/eg_mouse2.jpg" } </script> </head> <body> <a href="http://www.w3school.com.cn" onmouseover="mouseOver()" onmouseout="mouseOut()"> <img alt="Visit W3School!" src="/i/eg_mouse2.jpg" id="b1" /> </a> </body> </html>
<p class="wscp_t"> {dede:type typeid=11}<a href="[field:typelink/]" class="wscp_on" id="wscp_1" onmouseover="tabname1('wscp_','wscp_a','1','9','wscp_on','wscp_off');" >[field:typename/]</a> {/dede:type} {dede:type typeid=12}<a href="[field:typelink/]" class="wscp_off" id="wscp_2" onmouseover="tabname1('wscp_','wscp_a','2','9','wscp_on','wscp_off');">[field:typename/]</a> {/dede:type} {dede:type typeid=13}<a href="[field:typelink/]" class="wscp_off" id="wscp_3" onmouseover="tabname1('wscp_','wscp_a','3','9','wscp_on','wscp_off');">[field:typename/]</a> {/dede:type} {dede:type typeid=14}<a href="[field:typelink/]" class="wscp_off" id="wscp_4" onmouseover="tabname1('wscp_','wscp_a','4','9','wscp_on','wscp_off');">[field:typename/]</a> {/dede:type} {dede:type typeid=15}<a href="[field:typelink/]" class="wscp_off" id="wscp_5" onmouseover="tabname1('wscp_','wscp_a','5','9','wscp_on','wscp_off');">[field:typename/]</a>{/dede:type} {dede:type typeid=16}<a href="[field:typelink/]" class="wscp_off" id="wscp_6" onmouseover="tabname1('wscp_','wscp_a','6','9','wscp_on','wscp_off');">[field:typename/]</a>{/dede:type} {dede:type typeid=19}<a href="[field:typelink/]" class="wscp_off" id="wscp_7" onmouseover="tabname1('wscp_','wscp_a','7','9','wscp_on','wscp_off');">[field:typename/]</a>{/dede:type} {dede:type typeid=20}<a href="[field:typelink/]" class="wscp_off" id="wscp_8" onmouseover="tabname1('wscp_','wscp_a','8','9','wscp_on','wscp_off');">[field:typename/]</a>{/dede:type} </p>
<p class="wscp_c" id="wscp_a1" style="display:block;"> <ul> {dede:arclist row=4 typeid=11} <li> <a href="[field:arcurl/]" title="[field:title/]"><img src="[field:litpic/]" alt="[field:title/]" title="[field:title/]" width="262" height="325"/></a> <p><a href="[field:arcurl/]" title="[field:title/]">[field:title/]</a></p> </li> {/dede:arclist} </ul> </p>
以上是簡單介紹關於前端的onmouseover事件(實例)的詳細內容。更多資訊請關注PHP中文網其他相關文章!