0
我已經提到了像w3schools這樣的網站,但它顯示圖像變化onmouseover事件,在這裏我想顯示一些信息在表中是透明的,信息是關於頁面上的不同按鈕,怎麼可以我形成的代碼?我曾經嘗試這樣做:jquery onmouseover事件未能觸發
<script>
function info(z) {
z.style.visible = "true"
}
function defaultinfo(z) {
z.style.display = "block"
}
</script>
<style>
.menu_box {
background-color: #999;
padding: 2px;
color: #C0C0C0;
opacity: .9;
font-family: Garamond;
font-size: xx-large;
height: 91px;
width: 1125px;
}
</style>
<div id='cssmenu'>
<ul>
<li><span><a href="StudentDetails.aspx" title="stud" onmouseover="info(this)" onmouseout="defaultinfo(this)" visible="false">Students' Corner</a></span></li>
<li><span><a href="FacultyDetails.aspx" onmouseover="info(this)" onmouseout="defaultinfo(this)" visible="false">Staff Room</a></span></li>
<li><span><a href="LibWork.aspx" onmouseover="info(this)" onmouseout="defaultinfo(this)" visible="false">Librarian Workplace</a></span></li>
<li><span><a href="AccountSection.aspx" onmouseover="info(this)" onmouseout="defaultinfo(this)" visible="false">Account Section</a></span></li>
<li><span><a href="ContactUs.aspx" onmouseover="info(this)" onmouseout="defaultinfo(this)" visible="false">Contact Us</a></span></li>
<li><span><a href="ControlPanel.aspx" onmouseover="info(this)" onmouseout="defaultinfo(this)" visible="false">ERP ControlPanel</a></span></li>
</ul>
<span class="menu_box" id="defaultinfo" style="color: #FFFFFF; font-size: medium; font-style: italic">For information on this page, role the cursor over the buttons.
</span>
<span class="menu_box" id="info" style="color: #FFFFFF; font-size: medium; font-style: italic">The students' of saffrony institute of technology may use this button for their respective class notices,attendance and time-table. There are different modules such as "library" where students' can reserve books or request which are unavailable, or modules like "saffrony recycler" where seniors can upload their used-books and sell them to juniors. There are even modules like "student request" where you can post your requests and "student information" where you can view and update your own requests.
</span>
您已經定義了'function defaultinfo(z)',但是您正在調用'onmouseover =「info(this)」'。函數info()沒有被定義。 – showdev
我們需要看到你的JQuery代碼......另外,你不應該使用W3Schools來獲得JQuery幫助,使用他們的API ......這對於很好的例子來說非常有幫助:http://api.jquery.com/mouseover/ – Adjit
另請參見http://www.w3fools.com/ – Scimonster