<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="application/javascript">
$(".ddd").hover(
function () {
$(this).css({"background-color":"red","font-size":"200%"}); },
function () {
$(this).css({"background-color":"red","font-size":"200%"}); }
);</script>
</head><body>
<div style="width:500px; height:200px; position:relative; background:#C30;">
<div style="width:250px; height:200px; position:absolute; left:0px; top:0px; background:#000; z-index:9;"></div>
<div style="width:250px; height:100px; position:absolute; left:100px; top:55px; background:#00F;">
<a style="width:230px; height:60px; position:absolute; left:100px; top:0px; background:#FF0; z-index:9999; display:block; " class="ddd"></a>
</div>
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="application/javascript">
$(".ddd").hover(
function () {
$(this).css({"background-color":"red","font-size":"200%"}); },
function () {
$(this).css({"background-color":"red","font-size":"200%"}); }
);</script>
</head><body>
<div style="width:500px; height:200px; position:relative; background:#C30;">
<div style="width:250px; height:200px; position:absolute; left:0px; top:0px; background:#000; z-index:9;"></div>
<div style="width:250px; height:100px; position:absolute; left:100px; top:55px; background:#00F;">
<a style="width:230px; height:60px; position:absolute; left:100px; top:0px; background:#FF0; z-index:9999; display:block; " class="ddd"></a>
</div>
</div>
</body>
</html>
解决方案 »
- 看看这js代码,帮忙改一下
- $(document).ready qtip后 如何在后面动态改变呢?
- JS跨域求救
- js拖动图片或表格或div交换位置(ie和firefox都兼容)
- javascript 在表格中插入一列
- 抱..歉..只..剩..10..分..了... 请问在Html的字符串连接上单引号和双引号有啥区别. 都搞了好几天了, 还是没明白.
- 关于document.execCommand('InsertImage', false, imagePath)请指点小弟迷津
- 要吐血了JavaScriptT生成XML时出问题,是按书的例子做的,请高手指点(在线)
- 我的领导让我用javascript和数据库通信,真是恐慌怖啊,各位谁做过啊
- 怎么判断输入的是不是正确的日期格式?vbscript用isdate(),用javascript怎么写?
- 刚开始学jquery,现在想实现一个效果,请大家帮忙
- flash单击的时候调用html里的一个javascript自定义函数
$(document).ready(function() {$(".ddd").hover(
function () {
$(this).css({"background-color":"red","font-size":"200%"}); },
function () {
$(this).css({"background-color":"red","font-size":"200%"}); }
);});</script>
$(".ddd").hover(
function () {
$(this).css({"background-color":"red","font-size":"200%"}); },
function () {
$(this).css({"background-color":"red","font-size":"200%"}); }
);
})
还有
<script type="application/javascript">
换成
<script type="text/javascript"><script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(function(){
$(".ddd").hover(
function () {
$(this).css({"background-color":"red","font-size":"200%"});
},
function () {
$(this).css({"background-color":"blue","font-size":"50%"});
}
);
});
</script>
<a style="width:230px; height:60px; position:absolute; left:100px; top:0px; background:#FF0; z-index:9999; display:block; " class="ddd">123</a>