首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

(急)请教这种关于div加载的代码如何写

2012-03-13 
(急)请问这种关于div加载的代码怎么写?网站是www.51240.com.点更多后。又加载了一些数据。这个是怎么实现。有

(急)请问这种关于div加载的代码怎么写?
网站是www.51240.com.

点更多后。又加载了一些数据。这个是怎么实现。有代码吗》?
原来的图片名称为更多。变成了现在的收起


[解决办法]
ajax获得数据,文档中增加新的dom元素显示数据。
代码别想了,谁知道你的页面是怎么写的。
[解决办法]

HTML code
<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>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;<a href="#">理肤</a>&nbsp;</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> 

热点排行