ajax实现tab控件

使用jQuery完成的tab控件,兼使用JavaScript实现的滚动页面,需要用到[u]jquery-tabs.js[/u]和[u]jquery-1.1.3.1.js[/u]包,页面调用如下:


<html>
<head>
<title>Tabs - jQuery</title>

<script src="jquery-1.1.3.1.js" type="text/javascript"></script>
<script src="jquery-tabs.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$('#container-1').tabs();
});
</script>
<style type="text/css" >
.tabs-hide {
display: none;
}
</style>
</head>
<body>
<h2>Simple Tabs</h2>
<div id="container-1">
<ul>
<li><a href="#fragment-1"><span>One</span></a></li>
<li><a href="#fragment-2"><span>Two</span></a></li>
<li><a href="#fragment-3"><span>Tabs are flexible again
</span></a></li>
</ul>
<div id="fragment-1">
<div id="marqueebox0" style="overflow:hidden;height:111px;line-height:22x;">
<table width="718" border="0" align="center" cellpadding="0" cellspacing="0">
<tr onmouseover="javascript:this.bgColor='#ffffff'" onmouseout="javascript:this.bgColor=''">
<td width="4%">f1</td>
</tr>
<tr onmouseover="javascript:this.bgColor='#ffffff'" onmouseout="javascript:this.bgColor=''">
<td width="4%">f2</td>
</tr>
<tr onmouseover="javascript:this.bgColor='#ffffff'" onmouseout="javascript:this.bgColor=''">
<td width="4%">f3</td>
</tr>
<tr onmouseover="javascript:this.bgColor='#ffffff'" onmouseout="javascript:this.bgColor=''">
<td width="4%">f4</td>
</tr>
<tr onmouseover="javascript:this.bgColor='#ffffff'" onmouseout="javascript:this.bgColor=''">
<td width="4%">f5</td>
</tr>
<tr onmouseover="javascript:this.bgColor='#ffffff'" onmouseout="javascript:this.bgColor=''">
<td width="4%">f6</td>
</tr>
<tr onmouseover="javascript:this.bgColor='#ffffff'" onmouseout="javascript:this.bgColor=''">
<td width="4%">f1</td>
</tr>
<tr onmouseover="javascript:this.bgColor='#ffffff'" onmouseout="javascript:this.bgColor=''">
<td width="4%">f2</td>
</tr>
<tr onmouseover="javascript:this.bgColor='#ffffff'" onmouseout="javascript:this.bgColor=''">
<td width="4%">f3</td>
</tr>
<tr onmouseover="javascript:this.bgColor='#ffffff'" onmouseout="javascript:this.bgColor=''">
<td width="4%">f4</td>
</tr>
<tr onmouseover="javascript:this.bgColor='#ffffff'" onmouseout="javascript:this.bgColor=''">
<td width="4%">f5</td>
</tr>
<tr onmouseover="javascript:this.bgColor='#ffffff'" onmouseout="javascript:this.bgColor=''">
<td width="4%">f6</td>
</tr>
</table>
</div>
</div>
<div id="fragment-2">
<div id="marqueebox0" style="overflow:hidden;height:111px;line-height:22x;">
<table width="718" border="0" align="center" cellpadding="0" cellspacing="0">
<tr onmouseover="javascript:this.bgColor='#ffffff'" onmouseout="javascript:this.bgColor=''">
<td width="4%">f7</td>
</tr>
<tr onmouseover="javascript:this.bgColor='#ffffff'" onmouseout="javascript:this.bgColor=''">
<td width="4%">f8</td>
</tr>
<tr onmouseover="javascript:this.bgColor='#ffffff'" onmouseout="javascript:this.bgColor=''">
<td width="4%">f9</td>
</tr>
<tr onmouseover="javascript:this.bgColor='#ffffff'" onmouseout="javascript:this.bgColor=''">
<td width="4%">f10</td>
</tr>
<tr onmouseover="javascript:this.bgColor='#ffffff'" onmouseout="javascript:this.bgColor=''">
<td width="4%">f11</td>
</tr>
<tr onmouseover="javascript:this.bgColor='#ffffff'" onmouseout="javascript:this.bgColor=''">
<td width="4%">f12</td>
</tr>
<tr onmouseover="javascript:this.bgColor='#ffffff'" onmouseout="javascript:this.bgColor=''">
<td width="4%">f9</td>
</tr>
<tr onmouseover="javascript:this.bgColor='#ffffff'" onmouseout="javascript:this.bgColor=''">
<td width="4%">f10</td>
</tr>
<tr onmouseover="javascript:this.bgColor='#ffffff'" onmouseout="javascript:this.bgColor=''">
<td width="4%">f11</td>
</tr>
</table>
</div>
</div>
<div id="fragment-3">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
</div>
<script>
<!--
function startmarquee(lh,speed,delay,index){
var t;
var p=false;
var o=document.getElementById("marqueebox"+index);
o.innerHTML+=o.innerHTML;
o.onmouseover=function(){p=true}
o.onmouseout=function(){p=false}
o.scrollTop = 0;
function start(){
t=setInterval(scrolling,speed);
if(!p) o.scrollTop += 2;
}
function scrolling(){
if(o.scrollTop%lh!=0){
o.scrollTop += 2;
if(o.scrollTop>=o.scrollHeight/2) o.scrollTop = 0;
}else{
clearInterval(t);
setTimeout(start,delay);
}
}
setTimeout(start,delay);
}
startmarquee(22,50,3000,0);
/**startmarquee(一次滚动高度,速度,停留时间,图层标记);**/

//-->
</script>
</div>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值