<div id="a"> <div id="b"></div> </div> javascript,如何以指定html文件的方式提取其所有代码,替换掉#b
展开全部
<HEAD>
<TITLE>如何通过JS实现鼠标经过图片1.gif 2.gif 3.gif 4.gif的时候动态的提取这些图片的title指到box2中 </TITLE>
<style type="text/css">
.on{padding15px 10px; font-weightbold;colorred;}
.off{padding0px 0px; font-weightthin;colorblack;}
</style>
<script type="text/javascript" src="jquery-1.8.0.js"></script>
<script type="text/javascript" src="jquery-1.8.0.min.js"></script>
<script>
jQuery(function($) {
$('#box img').each(function(){
$(this).bind('mouseenter mouseleave',function(){
var t = '|'+this.title+'|';
if($("#box2").text().indexOf(t)==-1)
{
$("#box2").text($("#box2").text()+t);
}
});
});
});
</script>
</HEAD>
<BODY>
<div class="box" id="box">
<a href="#" class="pic1">
<img src="mouse_drag\images\b.gif" title="1" />
</a>
<a href="#" class="pic2">
<img src="mouse_drag\images\b.gif" title="2" />
</a>
<a href="#" class="pic3">
<img src="mouse_drag\images\p.gif" title="3" />
</a>
<a href="#" class="pic4">
<img src="mouse_drag\images\g.gif" title="4" />
</a>
</div>
<div class="box2" id="box2"></div>
</BODY>
<TITLE>如何通过JS实现鼠标经过图片1.gif 2.gif 3.gif 4.gif的时候动态的提取这些图片的title指到box2中 </TITLE>
<style type="text/css">
.on{padding15px 10px; font-weightbold;colorred;}
.off{padding0px 0px; font-weightthin;colorblack;}
</style>
<script type="text/javascript" src="jquery-1.8.0.js"></script>
<script type="text/javascript" src="jquery-1.8.0.min.js"></script>
<script>
jQuery(function($) {
$('#box img').each(function(){
$(this).bind('mouseenter mouseleave',function(){
var t = '|'+this.title+'|';
if($("#box2").text().indexOf(t)==-1)
{
$("#box2").text($("#box2").text()+t);
}
});
});
});
</script>
</HEAD>
<BODY>
<div class="box" id="box">
<a href="#" class="pic1">
<img src="mouse_drag\images\b.gif" title="1" />
</a>
<a href="#" class="pic2">
<img src="mouse_drag\images\b.gif" title="2" />
</a>
<a href="#" class="pic3">
<img src="mouse_drag\images\p.gif" title="3" />
</a>
<a href="#" class="pic4">
<img src="mouse_drag\images\g.gif" title="4" />
</a>
</div>
<div class="box2" id="box2"></div>
</BODY>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询