散分,发个个ASP+AJAX的小例子。。。
测试地址。。
http://www.zhb.org.cn/wc/search/search.htm
源码下载。。
http://www.zhb.org.cn/wc/search/code.rar
顺便在贴几个JS小特效。。。
忘各位老师指点。。
一:滚动(marquee)。。
<html>
<head>
<script type= "text/javascript ">
function $(id) {
return document.getElementById(id);
}
function marquee(time, oa, ol, or) {
/*
marquee 实现类(修改某某的思路,不知道是谁想的,反正不是我^o^)
time 值越大速度越慢;
oa最外层div
ol左边的td
or右边的td
*/
var timer, width = ol.offsetWidth;
function move() {
//当滚动条移动到最后时,把它移回开头即0
if (oa.scrollLeft > = width)
oa.scrollLeft = 0;
else
oa.scrollLeft ++;
}
or.innerHTML = ol.innerHTML;
oa.style.overflow = "hidden ";
or.style.width = ol.offsetWidth;
oa.onmouseover = function () {
window.clearInterval(timer);
};
oa.onmouseout = function () {
timer = window.setInterval(move, time);
};
timer = window.setInterval(move, time);
};
window.onload = function () {
new marquee(25, $( "demo "), $( "demo1 "), $( "demo2 "));
}
</script>
</head>
<body>
<div id= "demo " style= "border:#CCCCCC 1px dashed; width:300px; "> <!--设置显示的宽度-->
<table cellspacing= "0 " cellpadding= "0 ">
<tbody>
<tr>
<td id= "demo1 ">
<table width= "342 " cellpadding= "0 " cellspacing= "0 "> <!--注意这里的宽度必须设置,并且要设置为具体值-->
<tr align= "center ">
<td> Left </td>
<td> Right </td>
</tr>
</table>
</td>
<td id= "demo2 "> </td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
二:浮动广告。。
<html>
<head>
<style type= "text/css ">
body {
height:100%;
}
#window, #window1 {
z-index:99;
position:absolute;
height:100px;
width:100px;
background-color:#CCCCCC;
}