(急)请问这种关于div加载的代码怎么写? 网站是www.51240.com.点更多后。又加载了一些数据。这个是怎么实现。有代码吗》?原来的图片名称为更多。变成了现在的收起 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 请看大图。http://www.zxjcm.cn/1.jpghttp://www.zxjcm.cn/2.jpg ajax获得数据,文档中增加新的dom元素显示数据。代码别想了,谁知道你的页面是怎么写的。 <html ><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><title></title><body><div id="main" style="width:600px;" ><div class="" style="position:relative; float:left; width:600px;"> <div> <div id="title1" style="float:left;" >aaa</div> <div class="bt" style="float:right;"><img id="button1" style="float:right;" onClick="show('button1','contain1');" src="http://www.douban.com/pics/arrow0.gif"></div> </div> <div id="contain1" style="clear:both;padding:20px;overflow:hidden;"> 理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa </div> </div> <div > <div id="title3" style="float:left;" >aaa </div> <img id="button3" style="float:right;" onClick="show('button2','contain2');" src="http://www.douban.com/pics/arrow0.gif"> </div> <div id="contain3" style="clear:both;padding:20px;overflow:hidden;"> 理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔</div> <div id="title2" style="float:left;" >aaa </div> <img id="button2" style="float:right;" onClick="show('button2','contain2');" src="http://www.douban.com/pics/arrow0.gif"> </div> <div id="contain2" style="clear:both;padding:20px;overflow:hidden;"> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> </div></div><script type="text/javascript" >function $(id){ return document.getElementById(id);}function hide(c,m){ if($(c).innerHTML.length>200){ $(c).setAttribute("r",$(c).innerHTML); $(c).innerHTML=$(c).innerHTML.substr(0,150)+""; } $(m).src="http://www.douban.com/pics/arrow0.gif"; $(m).onclick=function(){show(c,m)};}function show(c,m){ $(c).innerHTML=$(c).getAttribute("r") || $(c).innerHTML; $(m).src="http://www.douban.com/pics/arrow1.gif"; $(m).onclick=function(){hide(c,m)};}hide("contain1","button1");hide("contain2","button2");hide("contain3","button3");</script></body></html>你试试这个吧!! 一个jquery选择器的问题 怎么实现图片不停地向左滚动? 如果在同一页面实现不同样式滑动门效果? Webqq聊天对话框 JavaScript中的With、setCapture和releaseCapture帮解释一下。 如何用JS更改浏览器的颜色 为什么document.body.clientHeight 和document.body.offsetHeight 一样??? javascript 特殊文字的问题比如 ó 动态控制CSS的问题 list模式的下拉框怎么控制只能有一个值??? JavaScript数组,加上AJAX之后,竟然变了,我茫然了 求教关于作用域的问题
http://www.zxjcm.cn/1.jpg
http://www.zxjcm.cn/2.jpg
代码别想了,谁知道你的页面是怎么写的。
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<title>
</title>
<body>
<div id="main" style="width:600px;" >
<div class="" style="position:relative; float:left; width:600px;">
<div>
<div id="title1" style="float:left;" >aaa</div>
<div class="bt" style="float:right;"><img id="button1" style="float:right;" onClick="show('button1','contain1');" src="http://www.douban.com/pics/arrow0.gif"></div>
</div>
<div id="contain1" style="clear:both;padding:20px;overflow:hidden;">
理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa
</div>
</div>
<div >
<div id="title3" style="float:left;" >aaa </div>
<img id="button3" style="float:right;" onClick="show('button2','contain2');" src="http://www.douban.com/pics/arrow0.gif">
</div>
<div id="contain3" style="clear:both;padding:20px;overflow:hidden;">
理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔芙Sspa理肤泉薇姿雅漾贝德玛芙丽芳丝"无添加"药妆色林达瑞肤德国世家丝塔芙SspanNspan依泉雅漾丝塔
</div>
<div id="title2" style="float:left;" >aaa </div>
<img id="button2" style="float:right;" onClick="show('button2','contain2');" src="http://www.douban.com/pics/arrow0.gif">
</div>
<div id="contain2" style="clear:both;padding:20px;overflow:hidden;">
<a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> <a href="#">理肤</a> </div>
</div>
<script type="text/javascript" >
function $(id){
return document.getElementById(id);
}
function hide(c,m){
if($(c).innerHTML.length>200){
$(c).setAttribute("r",$(c).innerHTML);
$(c).innerHTML=$(c).innerHTML.substr(0,150)+"";
}
$(m).src="http://www.douban.com/pics/arrow0.gif";
$(m).onclick=function(){show(c,m)};
}
function show(c,m){
$(c).innerHTML=$(c).getAttribute("r") || $(c).innerHTML;
$(m).src="http://www.douban.com/pics/arrow1.gif";
$(m).onclick=function(){hide(c,m)};
}
hide("contain1","button1");
hide("contain2","button2");
hide("contain3","button3");
</script>
</body>
</html>你试试这个吧!!