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

图片连续滚动代码,该如何解决

2012-01-31 
图片连续滚动代码网上好多的连续滚动代码我都试过了,都不行,.net程序动态添加图片的那种好多静态的我改了,

图片连续滚动代码
网上好多的连续滚动代码我都试过了,都不行,.net程序动态添加图片的   那种
好多静态的我改了,好多都不是连续滚动

[解决办法]
沙发。
[解决办法]
用gridview 绑定图片

然后用marquee也不行吗?
[解决办法]
你这个滚动图片 javascript 就可以实现啊
[解决办法]
犹豫了下
就没坐到沙发了
[解决办法]
<div style= "overflow:hidden;height:130px ">
<p id= "marquees1 "> <table width= "100% " border= "0 " cellspacing= "0 " cellpadding= "0 "> <tr> <td class= "left1 ">
<a class= "rlk " target= "_blank " href= "/a/20070417/002264.htm "> 欧盟暂不考虑参与美国对华知识产权诉讼 </a> <span class= "text06 "> (17日12:36) </span> <br> <a class= "rlk " target= "_blank " href= "/a/20070417/002261.htm "> 我国有104种野生植物物种面临极危或濒危 </a> <span class= "text06 "> (17日12:33) </span> <br> <a class= "rlk " target= "_blank " href= "/a/20070417/002256.htm "> 我国第5支维和警察防暴队开始在海地执行任务 </a> <span class= "text06 "> (17日12:29) </span> <br> <a class= "rlk " target= "_blank " href= "/a/20070417/002249.htm "> 开发商竞相聘用下海土地官员 开出百万年薪 </a> <span class= "text06 "> (17日12:23) </span> <br> <a class= "rlk " target= "_blank " href= "/a/20070417/002267.htm "> 河北鹿泉工地塔吊大臂折断 两名塔吊司机死亡 </a> <span class= "text06 "> (17日12:39) </span> <br> <a class= "rlk " target= "_blank " href= "/a/20070417/002201.htm "> 我国将出台一个保护奥林匹克标志的行动方案 </a> <span class= "text06 "> (17日11:45) </span> <br> <a class= "rlk " target= "_blank " href= "/a/20070417/002198.htm "> 美称中国对市场准入限制致盗版盛行说法错误 </a> <span class= "text06 "> (17日11:45) </span> <br> <a class= "rlk " target= "_blank " href= "/a/20070417/002197.htm "> 巴西一直升飞机坠毁6人遇难 </a> <span class= "text06 "> (17日11:44) </span> <br> <a class= "rlk " target= "_blank " href= "/a/20070417/002195.htm "> 内蒙古16名干部将因一起黄河坠车事故被问责 </a> <span class= "text06 "> (17日11:43) </span> <br> <a class= "rlk " target= "_blank " href= "/a/20070417/002214.htm "> 剑桥大学快乐调查:丹麦芬兰是欧洲最快乐国家 </a> <span class= "text06 "> (17日11:53) </span> <br>
</td> </tr> </table> </p>
<script language= "javascript ">
<!--
marqueesHeight=130;
stopscroll=false;
with(marquees1)
{
noWrap=true;
style.width=243;
style.height=marqueesHeight;
style.overflowY= "hidden ";
onmouseover=new Function( "stopscroll=true "); onmouseout=new Function( "stopscroll=false ");
}

document.write( ' <p id= "templayer " style= "position:absolute;z-index:1;visibility:hidden "> </p> ');
function mrinit()
{ //
while(templayer.offsetHeight <marqueesHeight)
{
templayer.innerHTML+=marquees1.innerHTML;
}
marquees1.innerHTML=templayer.innerHTML+templayer.innerHTML;
setInterval( "scrollUp() ",30);
}


preTop=0;
function scrollUp()
{
if(stopscroll==true) return;
preTop=marquees1.scrollTop;
marquees1.scrollTop+=1; //当然不仅如此,同样还要向下滚动一个像素(+1):
if(preTop==marquees1.scrollTop)
{
marquees1.scrollTop=templayer.offsetHeight-marqueesHeight+1;
}
}
mrinit();
-->
</script>
</div>
字的可以。
你试一下图片的。
[解决办法]
连续滚动和.net有关系吗? 显示在页面的永远是html
[解决办法]
<script language= "JavaScript1.2 ">

/*
Left-Right image slideshow Script-
By Dynamic Drive (www.dynamicdrive.com)
For full source code, terms of use, and 100 's more scripts, visit http://dynamicdrive.com
*/

///////configure the below four variables to change the style of the slider///////
//set the scrollerwidth and scrollerheight to the width/height of the LARGEST image in your slideshow!
var scrollerwidth=100
var scrollerheight=106
var scrollerbgcolor= 'white '
//3000 miliseconds=3 seconds
var pausebetweenimages=3000


//configure the below variable to change the images used in the slideshow. If you wish the images to be clickable, simply wrap the images with the appropriate <a> tag
var slideimages=new Array()
slideimages[0]= ' <a href= "../../../www.cnn.com/index.html "> <img src= "../dynamicindex4/PE01805A.gif " border=0 "> </a> '
slideimages[1]= ' <img src= "../dynamicindex4/PE01803A.gif "> '
slideimages[2]= ' <img src= "../dynamicindex4/TN00411A.gif "> '
slideimages[3]= ' <img src= "../dynamicindex4/PE02054A.gif "> '
slideimages[4]= ' <img src= "../dynamicindex4/cake.gif "> '
//extend this list

///////Do not edit pass this line///////////////////////


if (slideimages.length> 1)
i=2
else
i=0

function move1(whichlayer){
tlayer=eval(whichlayer)
if (tlayer.left> 0&&tlayer.left <=5){
tlayer.left=0
setTimeout( "move1(tlayer) ",pausebetweenimages)
setTimeout( "move2(document.main.document.second) ",pausebetweenimages)
return
}
if (tlayer.left> =tlayer.document.width*-1){
tlayer.left-=5
setTimeout( "move1(tlayer) ",100)
}
else{
tlayer.left=scrollerwidth+5
tlayer.document.write(slideimages[i])
tlayer.document.close()
if (i==slideimages.length-1)
i=0
else
i++
}
}

function move2(whichlayer){
tlayer2=eval(whichlayer)
if (tlayer2.left> 0&&tlayer2.left <=5){
tlayer2.left=0
setTimeout( "move2(tlayer2) ",pausebetweenimages)
setTimeout( "move1(document.main.document.first) ",pausebetweenimages)
return
}
if (tlayer2.left> =tlayer2.document.width*-1){
tlayer2.left-=5
setTimeout( "move2(tlayer2) ",100)
}
else{
tlayer2.left=scrollerwidth+5
tlayer2.document.write(slideimages[i])
tlayer2.document.close()
if (i==slideimages.length-1)
i=0
else
i++
}
}

function move3(whichdiv){
tdiv=eval(whichdiv)
if (tdiv.style.pixelLeft> 0&&tdiv.style.pixelLeft <=5){
tdiv.style.pixelLeft=0
setTimeout( "move3(tdiv) ",pausebetweenimages)
setTimeout( "move4(second2) ",pausebetweenimages)
return
}
if (tdiv.style.pixelLeft> =tdiv.offsetWidth*-1){
tdiv.style.pixelLeft-=5


setTimeout( "move3(tdiv) ",100)
}
else{
tdiv.style.pixelLeft=scrollerwidth
tdiv.innerHTML=slideimages[i]
if (i==slideimages.length-1)
i=0
else
i++
}
}

function move4(whichdiv){
tdiv2=eval(whichdiv)
if (tdiv2.style.pixelLeft> 0&&tdiv2.style.pixelLeft <=5){
tdiv2.style.pixelLeft=0
setTimeout( "move4(tdiv2) ",pausebetweenimages)
setTimeout( "move3(first2) ",pausebetweenimages)
return
}
if (tdiv2.style.pixelLeft> =tdiv2.offsetWidth*-1){
tdiv2.style.pixelLeft-=5
setTimeout( "move4(second2) ",100)
}
else{
tdiv2.style.pixelLeft=scrollerwidth
tdiv2.innerHTML=slideimages[i]
if (i==slideimages.length-1)
i=0
else
i++
}
}

function startscroll(){
if (document.all){
move3(first2)
second2.style.left=scrollerwidth
}
else if (document.layers){
document.main.visibility= 'show '
move1(document.main.document.first)
document.main.document.second.left=scrollerwidth+5
document.main.document.second.visibility= 'show '
}
}

window.onload=startscroll

</script>


<ilayer id= "main " width=&{scrollerwidth}; height=&{scrollerheight}; bgColor=&{scrollerbgcolor}; visibility=hide>
<layer id= "first " left=1 top=0 width=&{scrollerwidth}; >
<script language= "JavaScript1.2 ">
if (document.layers)
document.write(slideimages[0])
</script>
</layer> <layer id= "second " left=0 top=0 width=&{scrollerwidth}; visibility=hide>
<script language= "JavaScript1.2 ">
if (document.layers)
document.write(slideimages[1])
</script>
</layer> </ilayer> <script language= "JavaScript1.2 ">
if (document.all){
document.writeln( ' <span id= "main2 " style= "position:relative;width: '+scrollerwidth+ ';height: '+scrollerheight+ ';overflow:hidden;background-color: '+scrollerbgcolor+ ' "> ')
document.writeln( ' <div style= "position:absolute;width: '+scrollerwidth+ ';height: '+scrollerheight+ ';clip:rect(0 '+scrollerwidth+ ' '+scrollerheight+ ' 0);left:0;top:0 "> ')
document.writeln( ' <div id= "first2 " style= "position:absolute;width: '+scrollerwidth+ ';left:1;top:0; "> ')
document.write(slideimages[0])
document.writeln( ' </div> ')
document.writeln( ' <div id= "second2 " style= "position:absolute;width: '+scrollerwidth+ ';left:0;top:0 "> ')
document.write(slideimages[1])
document.writeln( ' </div> ')
document.writeln( ' </div> ')
document.writeln( ' </span> ')
}
</script>

<p align= "center "> <font face= "Arial " size= "-2 "> Free DHTML scripts provided by <br>
<a href= "../../../dynamicdrive.com/index.html "> Dynamic Drive </a> </font> <p> </p>

热点排行