سلام
کد جاوایی وجود داره که با حرکت موس رویه تیبل رنگش رو عوض کنه؟
Printable View
سلام
کد جاوایی وجود داره که با حرکت موس رویه تیبل رنگش رو عوض کنه؟
سلام.
لطفا جستوجو کنید...
خب این سایت یاسر جان که همیشه در دسترس شماست!!!!
[HTML]<html>کد:http://www.neopersia.org/javascript/onmouseover.xhtml
http://www.neopersia.org/javascript/buttons.xhtml
<head>
</head>
<body>
<table border="1" style="background-color:red;">
<tr>
<td onMouseover="this.bgColor='green'" onMouseout="this.bgColor='blue'">
<span style="font-family:verdana;color:#ffffff;">p30world</span>
</td>
</tr>
</table>
</body>
</html>[/HTML]
مرسی امین جان
کدی که نوشتی توی همه مرورگرها کار میکنه
با اجازه من یه مدل دیگه از همین کد رو مینویسم که فقط برای اینترنت اکسپلورر از جاوا اسکرپت استفاده میکنه و برای بقیه مرورگرها از CSS استفاده میکنه
[html]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
#test-table {
width:250px;
margin:0 auto;
text-align:center;
}
#test-table tr {
background-color:#fff;
}
#test-table tr:hover {
background-color:#fc0;
}
</style>
<script type="text/javascript">
function Row_Hover() {
if(window.navigator.appName != "Microsoft Internet Explorer") {
return;
}
var myTable = document.getElementById("test-table");
for (var i=0; i<myTable.rows.length; i++) {
myTable.rows[i].onmouseover = function() {
this.style.backgroundColor = '#fc0';
}
myTable.rows[i].onmouseout = function() {
this.style.backgroundColor = '#fff';
}
}
}
window.onload = Row_Hover;
</script>
</head>
<body>
<table id="test-table" border="1" cellpadding="5">
<tr><td>Row 1</td></tr>
<tr><td>Row 2</td></tr>
<tr><td>Row 3</td></tr>
<tr><td>Row 4</td></tr>
</table>
</body>
</html>
[/html]
سلام.
اصلا بهترین روش همینه!!!
این ie دیگه چه بشریه!!!! از رو هم نمی ره...