我正在使用 Raphael 图形和动画,这是一个 javascript 库。我希望用户将鼠标悬停在底行中间列的蓝色方块上。当他们将鼠标悬停时,我希望蓝色框发光(拉斐尔函数)黑色。我正在尝试在 rec8 上使用此功能,但我认为我做得不对。有人可以更正我的代码或帮助我。谢谢。:) 健康长寿·繁荣昌盛。
<html>
<head><title></title>
<script src="raphael-min.js"></script>
<script src="jquery-1.7.2.js"></script>
<style type="text/css">
#input
{
margin-top:-200px;
}
</style>
</head>
<body>
<div id="draw-here-raphael" style="height: 400px; width: 400px; background: #666; z-index:0;">
</div>
<div id="input" style="z-index:99;" >
<input type="text" value="0"; style="text-align:right;" /><br />
</form>
</div>
<script type="text/javascript">
//all your javascript goes here
$(function() {
var r = new Raphael("draw-here-raphael"),
// Store where the box is
position = 'left',
// Make our pink rectangle
rec = r.rect(20, 20, 250, 300, 10).attr({"fill": "#fbb"});
$("rect").mouseover(function(e) {
$(this).attr({"fill": "red"});
});
$("rect").mouseout(function(e) {
$(this).attr({"fill": "#fbb"});
});
//first column
rec2 = r.rect(30, 80, 50, 40, 5).attr({"fill": "blue"});
rec3 = r.rect(30, 130, 50, 40, 5).attr({"fill": "blue"});
rec4 = r.rect(30, 180, 50, 40, 5).attr({"fill": "blue"});
rec5 = r.rect(30, 240, 50, 40, 5).attr({"fill": "blue"});
//second column
rec6 = r.rect(90, 80, 50, 40, 5).attr({"fill": "blue"});
rec2 = r.rect(90, 130, 50, 40, 5).attr({"fill": "blue"});
rec7 = r.rect(90, 180, 50, 40, 5).attr({"fill": "blue"});
rec8 = r.rect(90, 240, 50, 40, 5).attr({"fill": "blue"});
$("rec8").mouseover(function(e) {
$(this).glow({width:10});
});
$("rec8").mouseout(function(e) {
$(this).glow({width:0});
});
//third column
rec9 = r.rect(150, 80, 50, 40, 5).attr({"fill": "blue"});
rec10 = r.rect(150, 130, 50, 40, 5).attr({"fill": "blue"});
rec11 = r.rect(150, 180, 50, 40, 5).attr({"fill": "blue"});
rec12 = r.rect(150, 240, 50, 40, 5).attr({"fill": "blue"});
});
</script>
</body>
</html>