combotree 怎样设置水平滚动条,急急,求解!!!
1个回答
展开全部
<script type="text/javascript">
<!--
//图片滚动函数
function picScroll(pic,direction,n)
{
var getArr = new Array();
var move;
var length;
if(n==undefined){
n=1
}else{
n = 2*n-1;
}
switch(direction)
{
case 'top':
{
if(pic[0].offsetHeight<=(1/n)*pic[0].scrollTop)
{
pic[0].scrollTop -=n*pic[0].offsetHeight
}else{
pic[0].scrollTop +=1;
}
break;
}
case 'left':
{
if(pic[0].offsetWidth<=(1/n)*pic[0].scrollLeft)
{
pic[0].scrollLeft -=n*pic[0].offsetWidth
}else{
pic[0].scrollLeft +=1;
}
break;
}
case 'right':
{
break;
}
case 'bottom':
{
break;
}
default:
{//默认是left
if(pic[0].offsetWidth<=pic[0].scrollLeft)
{
pic[0].scrollLeft -=pic[0].offsetWidth
}else{
pic[0].scrollLeft +=1;
}
break;
}
}
}
//-->
</script>
<style>
.pic-wap{
height:160px;
margin:0;
width:650px;
margin:0px 0 0 40px;
overflow:hidden;
}
.pic-in{
width:300%;
}
.pic-wap dl{
float:left;
width:105px;
height:113px;
margin:0px;
padding-left: 13px; padding-right: 12px;
background-image: url(images/ykt/pic_bj.jpg);
height:150px;
background-repeat: no-repeat;
background-position: center;
}
.pic-wap dt{
height:40px;width:105px; line-height:40px; text-align:center; font-size:12px; font-weight:bold;
color:#555;
}
.pic-wap dt a{
font-size:12px;
font-weight: normal;
}
</style>
<div class="pic-wap" id="pic-wap">
<div class="pic-in" id="pic-in">
<div id="picture1">
<dl>
<dt>
<a href="/index.php?action=showpic&pid=41" title="few">
few </a>
</dt>
<dd>
<a href="/index.php?action=showpic&pid=41" title="few">
<img width="105" height="80" src="/uploadfiles/2011/0113/thumb/thumb_1294885360_0.jpg">
</a>
</dd>
</dl>
<dl>
<dt>
<a href="/index.php?action=showpic&pid=40" title="1uuyfrwesadf">
1uuyf<font style="font-size: 12px;">....</font> </a>
</dt>
<dd>
<a href="/index.php?action=showpic&pid=40" title="1uuyfrwesadf">
<img width="105" height="80" src="/uploadfiles/2011/0113/thumb/thumb_1294905400_0.jpg">
</a>
</dd>
</dl>
<dl>
<dt>
<a href="/index.php?action=showpic&pid=39" title="正式密钥导入暨系统集成商签约仪式">
正式密钥导<font style="font-size: 12px;">....</font> </a>
</dt>
<dd>
<a href="/index.php?action=showpic&pid=39" title="正式密钥导入暨系统集成商签约仪式">
<img width="105" height="80" src="/uploadfiles/2011/0111/thumb/thumb_1294714344_0.jpg">
</a>
</dd>
</dl>
<dl>
<dt>
<a href="/index.php?action=showpic&pid=38" title="我们的事业">
我们的事业 </a>
</dt>
<dd>
<a href="/index.php?action=showpic&pid=38" title="我们的事业">
<img width="105" height="80" src="/uploadfiles/2011/0111/thumb/thumb_1294714232_0.jpg">
</a>
</dd>
</dl>
<dl>
<dt>
<a href="/index.php?action=showpic&pid=36" title="为荣誉而工作">
为荣誉而工<font style="font-size: 12px;">....</font> </a>
</dt>
<dd>
<a href="/index.php?action=showpic&pid=36" title="为荣誉而工作">
<img width="105" height="80" src="/uploadfiles/2011/0111/thumb/thumb_1294713870_0.jpg">
</a>
</dd>
</dl>
</div>
<div id="picture2"></div>
</div>
</div>
<script>
//这是图片展示的脚本start
var pic=$('.new #pic-wap');
var pic1 = pic.find('#picture1');
var pic2 = pic.find('#picture2');
pic2.html(pic1.html());
timers=setInterval("picScroll(pic,'left')",scrollSpeed);
$('.new #pic-wap').hover(
function(){ clearInterval(timers);
},
function(){
timers=setInterval("picScroll(pic,'left')",scrollSpeed);
}
);
</script>
<!--
//图片滚动函数
function picScroll(pic,direction,n)
{
var getArr = new Array();
var move;
var length;
if(n==undefined){
n=1
}else{
n = 2*n-1;
}
switch(direction)
{
case 'top':
{
if(pic[0].offsetHeight<=(1/n)*pic[0].scrollTop)
{
pic[0].scrollTop -=n*pic[0].offsetHeight
}else{
pic[0].scrollTop +=1;
}
break;
}
case 'left':
{
if(pic[0].offsetWidth<=(1/n)*pic[0].scrollLeft)
{
pic[0].scrollLeft -=n*pic[0].offsetWidth
}else{
pic[0].scrollLeft +=1;
}
break;
}
case 'right':
{
break;
}
case 'bottom':
{
break;
}
default:
{//默认是left
if(pic[0].offsetWidth<=pic[0].scrollLeft)
{
pic[0].scrollLeft -=pic[0].offsetWidth
}else{
pic[0].scrollLeft +=1;
}
break;
}
}
}
//-->
</script>
<style>
.pic-wap{
height:160px;
margin:0;
width:650px;
margin:0px 0 0 40px;
overflow:hidden;
}
.pic-in{
width:300%;
}
.pic-wap dl{
float:left;
width:105px;
height:113px;
margin:0px;
padding-left: 13px; padding-right: 12px;
background-image: url(images/ykt/pic_bj.jpg);
height:150px;
background-repeat: no-repeat;
background-position: center;
}
.pic-wap dt{
height:40px;width:105px; line-height:40px; text-align:center; font-size:12px; font-weight:bold;
color:#555;
}
.pic-wap dt a{
font-size:12px;
font-weight: normal;
}
</style>
<div class="pic-wap" id="pic-wap">
<div class="pic-in" id="pic-in">
<div id="picture1">
<dl>
<dt>
<a href="/index.php?action=showpic&pid=41" title="few">
few </a>
</dt>
<dd>
<a href="/index.php?action=showpic&pid=41" title="few">
<img width="105" height="80" src="/uploadfiles/2011/0113/thumb/thumb_1294885360_0.jpg">
</a>
</dd>
</dl>
<dl>
<dt>
<a href="/index.php?action=showpic&pid=40" title="1uuyfrwesadf">
1uuyf<font style="font-size: 12px;">....</font> </a>
</dt>
<dd>
<a href="/index.php?action=showpic&pid=40" title="1uuyfrwesadf">
<img width="105" height="80" src="/uploadfiles/2011/0113/thumb/thumb_1294905400_0.jpg">
</a>
</dd>
</dl>
<dl>
<dt>
<a href="/index.php?action=showpic&pid=39" title="正式密钥导入暨系统集成商签约仪式">
正式密钥导<font style="font-size: 12px;">....</font> </a>
</dt>
<dd>
<a href="/index.php?action=showpic&pid=39" title="正式密钥导入暨系统集成商签约仪式">
<img width="105" height="80" src="/uploadfiles/2011/0111/thumb/thumb_1294714344_0.jpg">
</a>
</dd>
</dl>
<dl>
<dt>
<a href="/index.php?action=showpic&pid=38" title="我们的事业">
我们的事业 </a>
</dt>
<dd>
<a href="/index.php?action=showpic&pid=38" title="我们的事业">
<img width="105" height="80" src="/uploadfiles/2011/0111/thumb/thumb_1294714232_0.jpg">
</a>
</dd>
</dl>
<dl>
<dt>
<a href="/index.php?action=showpic&pid=36" title="为荣誉而工作">
为荣誉而工<font style="font-size: 12px;">....</font> </a>
</dt>
<dd>
<a href="/index.php?action=showpic&pid=36" title="为荣誉而工作">
<img width="105" height="80" src="/uploadfiles/2011/0111/thumb/thumb_1294713870_0.jpg">
</a>
</dd>
</dl>
</div>
<div id="picture2"></div>
</div>
</div>
<script>
//这是图片展示的脚本start
var pic=$('.new #pic-wap');
var pic1 = pic.find('#picture1');
var pic2 = pic.find('#picture2');
pic2.html(pic1.html());
timers=setInterval("picScroll(pic,'left')",scrollSpeed);
$('.new #pic-wap').hover(
function(){ clearInterval(timers);
},
function(){
timers=setInterval("picScroll(pic,'left')",scrollSpeed);
}
);
</script>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询