div 固定高度600px,宽度100%
动态从数据库中取30条数据js实现取出的数据逐条向上滚动,这个怎么实现?另:页面刚开始使用时,可能数据没有30条,也要实现滚动效果求解,谢谢了。
动态从数据库中取30条数据js实现取出的数据逐条向上滚动,这个怎么实现?另:页面刚开始使用时,可能数据没有30条,也要实现滚动效果求解,谢谢了。
解决方案 »
- 紧急求助:如何判断Html元素是否相等
- 如何取得当前日期和时间,分别显示在两个text框中?
- 问个初级问题——关于做个脚本让别人引用的问题!
- 未设置宽度的DIV,如何得到宽度值?
- 如何左右拖动图片
- 我参加福建省第二届软件技术大赛的获奖作品
- 在JS中有没有什么属性是用来设置控件的焦点顺序的呀?
- 问一个很菜的问题!
- ★★★<%@LANGUAGE="JAVASCRIPT" %>和<%@LANGUAGE="VBSCRIPT" %> 高手进讨论在线 ★★★
- 请如何才能用一个提交按钮,就以可一次提交两个FORM里的内容??
- 用jquery怎么样实现下点击其他地方下拉菜单关闭 有部分代码
- 请问如何更新jquery datagrid 中单元格的值
<head>
<title>
Untitled
</title>
<script type="text/javascript" src="jquery.js">
</script>
<script>
$(document).ready(function() { function gun(id1, className, num, top) { var len = $(className).length; var nHeight = $(className).height();
var index = 0;
var adTimer = setInterval(function() {
scroll(index);
index++;
if (index == len) {
index = 0;
}
},
3000); var str = $(id1).html(); $(id1).hover(function() {
clearInterval(adTimer);
},
function() { adTimer = setInterval(function() {
scroll(index);
index++;
if (index == len) {
index = 0;
}
},
3000);
}).trigger("mouseleave");
function scroll(index) { if (len - index <= num) {
$(id1).append($(str)); $(id1).animate({
top: -index * (nHeight + top)
},
1500);
len = $(className).length;
} else {
$(id1).animate({
top: -index * (nHeight + top)
},
1500);
}
}
} gun("#comment_div1", "#comment_div1 .comment", 5, 11);
});
</script>
</head>
<body>
<div style="width:979px; height:auto !important; min-height:330px; height:330px; margin:auto; padding-top:10px;">
<div id="comment_div" style="position: relative;width:298px; margin-left:10px; border-top:1px solid #cccccc; height:300px; float:left;overflow:hidden;">
<div id="comment_div1" style="position: absolute;">
<div class="comment" style="width:298px; height:50px; border-bottom:1px dashed #dddddd; margin-top:10px;">
<div style="width:50px; height:50px; float:left;">
<img src="user_pic/CR-d8rfdOp7Aj.jpg" height="46" width="46" />
</div>
<div style="width:240px; height:40px; padding-top:10px; float:right; font-family:'宋体'; font-size:12px; line-height:18px; color:#666666;overflow:hidden;word-break: break-all;">
<a href="product_show.php?ID=1325">
sssssssssssssssssssssssssssssssss
</a>
 
</div>
</div>
<div class="comment" style="width:298px; height:50px; border-bottom:1px dashed #dddddd; margin-top:10px;">
<div style="width:50px; height:50px; float:left;">
<img src="user_pic/CR-d8rfdOp7Aj.jpg" height="46" width="46" />
</div>
<div style="width:240px; height:40px; padding-top:10px; float:right; font-family:'宋体'; font-size:12px; line-height:18px; color:#666666;overflow:hidden;word-break: break-all;">
<a href="product_show.php?ID=1325">
sssssssssssssssssss
</a>
 
</div>
</div>
<div class="comment" style="width:298px; height:50px; border-bottom:1px dashed #dddddd; margin-top:10px;">
<div style="width:50px; height:50px; float:left;">
<img src="user_pic/CR-d8rfdOp7Aj.jpg" height="46" width="46" />
</div>
<div style="width:240px; height:40px; padding-top:10px; float:right; font-family:'宋体'; font-size:12px; line-height:18px; color:#666666;overflow:hidden;word-break: break-all;">
<a href="product_show.php?ID=1319">
ssssssssssssssssssssssss
</a>
asdfghjkl;'dfghjkl;'fghjkl;'
</div>
</div>
<div class="comment" style="width:298px; height:50px; border-bottom:1px dashed #dddddd; margin-top:10px;">
<div style="width:50px; height:50px; float:left;">
<img src="user_pic/CR-d8rfdOp7Aj.jpg" height="46" width="46" />
</div>
<div style="width:240px; height:40px; padding-top:10px; float:right; font-family:'宋体'; font-size:12px; line-height:18px; color:#666666;overflow:hidden;word-break: break-all;">
<a href="product_show.php?ID=1323">
sssssssssssssssssssss
</a>
sssssssssssssssssssssssssssssssssssssssssss
</div>
</div>
<div class="comment" style="width:298px; height:50px; border-bottom:1px dashed #dddddd; margin-top:10px;">
<div style="width:50px; height:50px; float:left;">
<img src="user_pic/CR-d8rfdOp7Aj.jpg" height="46" width="46" />
</div>
<div style="width:240px; height:40px; padding-top:10px; float:right; font-family:'宋体'; font-size:12px; line-height:18px; color:#666666;overflow:hidden;word-break: break-all;">
<a href="product_show.php?ID=1325">
ssssssssssssssssssssssssss
</a>
ssss
</div>
</div>
<div class="comment" style="width:298px; height:50px; border-bottom:1px dashed #dddddd; margin-top:10px;">
<div style="width:50px; height:50px; float:left;">
<img src="user_pic/CR-d8rfdOp7Aj.jpg" height="46" width="46" />
</div>
<div style="width:240px; height:40px; padding-top:10px; float:right; font-family:'宋体'; font-size:12px; line-height:18px; color:#666666;overflow:hidden;word-break: break-all;">
<a href="product_show.php?ID=1308">
sssssssssssssssssssssssssssssssssss1
</a>
dasdasdasadsads
</div>
</div>
</div>
<div id="colee_bottom2">
</div>
</div>
</div>
</body></html>