
刚学JQUERY,写的这段代码哪出了问题,没反应
<!DOCTYPEhtml><html><head><scriptsrc="http://libs.baidu.com/jquery/1.10.2/jquery.min....
<!DOCTYPE html>
<html>
<head>
<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("#ccc").eq(1).fadeOut("slow");
});
});
</script>
</head>
<body>
<p>Demonstrate fadeOut() with different parameters.</p>
<button>Click to fade out boxes</button>
<br><br>
<div id="bbb">
<div id="ccc" style="width:80px;height:80px;background-color:red;"></div><br>
<div id="ccc" style="width:80px;height:80px;background-color:green;"></div><br>
<div id="ccc" style="width:80px;height:80px;background-color:blue;"></div>
</div>
</body>
</html> 展开
<html>
<head>
<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("#ccc").eq(1).fadeOut("slow");
});
});
</script>
</head>
<body>
<p>Demonstrate fadeOut() with different parameters.</p>
<button>Click to fade out boxes</button>
<br><br>
<div id="bbb">
<div id="ccc" style="width:80px;height:80px;background-color:red;"></div><br>
<div id="ccc" style="width:80px;height:80px;background-color:green;"></div><br>
<div id="ccc" style="width:80px;height:80px;background-color:blue;"></div>
</div>
</body>
</html> 展开
1个回答
展开全部
你好 首先解决问题 请问 id选择器 是否唯一 弄明白这个问题
如果你想重复使用样式 请不要id选择器 将ccc改为 类选择器 .ccc
希望能帮到你 谢谢 而且 $("#ccc").eq(1).fadeOut("slow");
完全可以改为 (".ccc:eq(1)").fadeOut("slow");
下面的标签 <div class="ccc"
样式 #ccc改为 .ccc
希望能帮到你 谢谢
如果你想重复使用样式 请不要id选择器 将ccc改为 类选择器 .ccc
希望能帮到你 谢谢 而且 $("#ccc").eq(1).fadeOut("slow");
完全可以改为 (".ccc:eq(1)").fadeOut("slow");
下面的标签 <div class="ccc"
样式 #ccc改为 .ccc
希望能帮到你 谢谢

2023-06-12 广告
单片机,单片微型计算机。它是把中央处理器(CPU)、随机存取存储器(RAM)、只读存储器(ROM)、输入/输出端口(I/O)等主要计算机功能部件都集成在一块集成电路芯片上的微型计算机。单片机具有性能高、速度快、体积小、价格低、稳定可靠、应用...
点击进入详情页
本回答由意法半导体(中国)投资有限公司提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询