我已经提到某些网站,比如w3schools,但它显示图像更改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>
答案 0 :(得分:1)
更改
function defaultinfo(z) {
z.style.visible = "true"
}
到
function defaultinfo(z) {
z.style.display = "block"
}
和html
visible="false"
到
style="display: none;"