📄 experiment8.htm
字号:
<html>
<head>
<title>experiment8</title>
<meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
<style>
.Item {
cursor: hand;
font-family: verdana;
font-size: 20;
font-style: normal;
background-color: darkgray;
color: white
}
.Highlight {
cursor: hand;
font-family: verdana;
font-size: 20;
font-style: italic;
background-color: dimgray;
color: yellow
}
</style>
</head>
<body>
<div id=div1><span class=Item>Milk</span>
<span class=Item>Cookies</span>
<span class=Item>Eggs</span>
<span class=Item>Ham</span>
<span class=Item>Cheese</span>
<span class=Item>Pasta</span>
<span class=Item>Chicken</span></div>
<script>
function rollon() {
if (window.event.srcElement.className == "Item") {
window.event.srcElement.className = "Highlight";
}
}
div1.onmouseover=rollon;
//document.onmouseover = rollon;
function rolloff() {
if (window.event.srcElement.className == "Highlight") {
window.event.srcElement.className = "Item";
}
}
div1.onmouseout = rolloff;
//document.onmouseout = rolloff;
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -