| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 814 人关注过本帖
标题:连续滚动图片问题求助
只看楼主 加入收藏
酷酷的鱼
Rank: 1
等 级:新手上路
威 望:1
帖 子:472
专家分:0
注 册:2005-8-9
收藏
 问题点数:0 回复次数:3 
连续滚动图片问题求助

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<table width="780" height="50" border="1" bordercolor="#000000">
<tr>

<script type="text/javascript">
document.write('<table align=center width=775 border=0 cellpadding=0 cellspacing=0 style=BORDER-LEFT: #cccccc 1px solid;BORDER-RIGHT: #cccccc 1px solid>');
document.write(' <tr> ');
document.write(' <td width=774 height=31 align=center class=border01 bgcolor=#FFFFFF>');
document.write(' <div id=demo style=overflow:hidden;width:750;align=center>');
document.write(' <table border=0 align=center cellpadding=1 cellspacing=1 cellspace=0 >');
document.write(' <tr>');
document.write(' <td valign=top bgcolor=ffffff id=marquePic1> ');
document.write(' <table width=100% border=0 cellspacing=0 cellpadding=0>');
document.write(' <tr align=center> ');
document.write(' <td><a href="http://www.cast.org.cn/" target="new"><img src="logo/castlogo.gif" width="161" height="50" border=0></a></td>');
document.write(' <td><a href="http://www.cpst.net.cn/" target="new"><img src="logo/cpstlogo.gif" width="179" height="50" border=0></a></td>');
document.write(' <td><a href="http://www.uisp.org.cn/uisp/index.jsp" target="new"><img src="logo/kplm.gif" width="160" height="50" border=0></a></td>');
document.write(' <td><a href="http://www.bjkp.gov.cn/bjkpzc/index.shtml" target="new"><img src="logo/bjkpzc.jpg" width="174" height="50" border=0></a></td>');
document.write(' <td><a href="http://www.losn.com.cn/" target="new"><img src="logo/kjzg.jpg" width="99" height="50" border=0></a></td>');
document.write(' <td><a href="http://www.sedu.org.cn/" target="new"><img src="logo/kxjy.jpg" width="154" height="50" border=0></a></td>');
document.write(' <td><a href="http://www.bast.net.cn/" target="new"><img src="logo/sdkjw.jpg" width="128" height="50" border=0></a></td>');
document.write(' <td><a href="http://www.stcity.net.cn/" target="new"><img src="logo/zgkp.jpg" width="178" height="50" border=0></a></td>');
document.write(' <td><a href="http://www.kepu.com.cn/gb/index.html" target="new"><img src="logo/zgkpbl.jpg" width="159" height="50" border=0></a></td>');
document.write(' <td><a href="http://www.91kp.cn/site/Default.aspx" target="new"><img src="logo/zgkppd.jpg" width="174" height="50" border=0></a></td>');
document.write(' <td><a href="http://www.cstm.org.cn/" target="new"><img src="logo/zgkxjsg.jpg" width="268" height="50" border=0></a></td>');
document.write(' </tr>');
document.write(' </table>');
document.write(' </td>');
document.write(' <td id=marquePic2 valign=top></td>');
document.write(' </tr>');
document.write(' </table>');
document.write(' </div>');
document.write(' </td>');
document.write(' </tr>');
document.write(' </table>');
var speed=15
marquePic2.innerHTML=marquePic1.innerHTML
function Marquee(){
if(demo.scrollLeft>=marquePic1.scrollWidth){
demo.scrollLeft=0
}else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}

</script></tr></table>

</body>
</html>
这是一个友情链接的连续滚动图片程序,鼠标放上,滚动会停止
我原来用这个程序都正常
现在只是换了换超连接和图片,怎么就不滚动了

搜索更多相关主题的帖子: dtd loose target 滚动 
2006-01-13 15:45
酷酷的鱼
Rank: 1
等 级:新手上路
威 望:1
帖 子:472
专家分:0
注 册:2005-8-9
收藏
得分:0 


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<table width="780" height="50" border="1" bordercolor="#000000">
<tr>

<script type="text/javascript">
document.write('<table align=center width=775 border=0 cellpadding=0 cellspacing=0 style=BORDER-LEFT: #cccccc 1px solid;BORDER-RIGHT: #cccccc 1px solid>');
document.write(' <tr> ');
document.write(' <td width=774 height=31 align=center class=border01 bgcolor=#FFFFFF>');
document.write(' <div id=demo style=overflow:hidden;width:750;align=center>');
document.write(' <table border=0 align=center cellpadding=1 cellspacing=1 cellspace=0 >');
document.write(' <tr>');
document.write(' <td valign=top bgcolor=ffffff id=marquePic1> ');
document.write(' <table width=100% border=0 cellspacing=0 cellpadding=0>');
document.write(' <tr align=center> ');
document.write(' <td><a href="http://www.cast.org.cn/" target="new"><img src="logo/castlogo.gif" width="161" height="50" border=0></a></td>');
document.write(' <td><a href="http://www.cpst.net.cn/" target="new"><img src="logo/cpstlogo.gif" width="179" height="50" border=0></a></td>');
document.write(' <td><a href="http://www.uisp.org.cn/uisp/index.jsp" target="new"><img src="logo/kplm.gif" width="160" height="50" border=0></a></td>');
document.write(' <td><a href="http://www.bjkp.gov.cn/bjkpzc/index.shtml" target="new"><img src="logo/bjkpzc.jpg" width="174" height="50" border=0></a></td>');
document.write(' <td><a href="http://www.losn.com.cn/" target="new"><img src="logo/kjzg.jpg" width="99" height="50" border=0></a></td>');
document.write(' <td><a href="http://www.sedu.org.cn/" target="new"><img src="logo/kxjy.jpg" width="154" height="50" border=0></a></td>');
document.write(' <td><a href="http://www.bast.net.cn/" target="new"><img src="logo/sdkjw.jpg" width="128" height="50" border=0></a></td>');
document.write(' <td><a href="http://www.stcity.net.cn/" target="new"><img src="logo/zgkp.jpg" width="178" height="50" border=0></a></td>');
document.write(' <td><a href="http://www.kepu.com.cn/gb/index.html" target="new"><img src="logo/zgkpbl.jpg" width="159" height="50" border=0></a></td>');
document.write(' <td><a href="http://www.91kp.cn/site/Default.aspx" target="new"><img src="logo/zgkppd.jpg" width="174" height="50" border=0></a></td>');
document.write(' <td><a href="http://www.cstm.org.cn/" target="new"><img src="logo/zgkxjsg.jpg" width="268" height="50" border=0></a></td>');
document.write(' </tr>');
document.write(' </table>');
document.write(' </td>');
document.write(' <td id=marquePic2 valign=top></td>');
document.write(' </tr>');
document.write(' </table>');
document.write(' </div>');
document.write(' </td>');
document.write(' </tr>');
document.write(' </table>');
var speed=15
marquePic2.innerHTML=marquePic1.innerHTML
function Marquee(){
if(demo.scrollLeft>=marquePic1.scrollWidth){
demo.scrollLeft=0
}else{
demo.scrollLeft++
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}

</script></tr></table>

</body>
</html>
这是一个友情链接的连续滚动图片程序,鼠标放上,滚动会停止
我原来用这个程序都正常
现在只是换了换超连接和图片,怎么就不滚动了


2006-01-13 15:46
冰镇柠檬汁儿
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:北京
等 级:版主
威 望:120
帖 子:8078
专家分:6657
注 册:2005-11-7
收藏
得分:0 

可能是<mapuee>的代码被一起删掉了


本来无一物,何处惹尘埃
It is empty at all here, Why pm 2.5 is so TMD high!
2006-01-13 16:54
suyongtao
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:33
帖 子:8674
专家分:127
注 册:2004-11-6
收藏
得分:0 

我刚弄了一个,不错......
<HTML>

<HEAD>
<TITLE>滚动图片</TITLE>
<style type="text/css">
<!--
#addbox {
position: relative;
width: 500px;
height: 70 px;
clip: rect(0px, 500px, 0px, 70px);
overflow: hidden;
}
#banner1 {
position: relative;
width: 480px;
height: 60px;
left: 0;
top: 5px;
}
#banner2 {
position: relative;
width: 480px;
height: 60px;
left: 500px;
top: -55px !important;
top:-58px;
}
-->
</style>

<script type="text/javascript">
<!--
//more javascript from http://www.smallrain.net

var displayTime, speed, wait, banner1, banner2, link1, link2, bannerIndex, bannerLocations, bannerURLs;

function initVar() {
displayTime = 10; // The amount of time each banner will be displayed in seconds.
speed = 5; // The speed at which the banners is moved (1 - 10, anything above 5 is not recommended).
wait = true;

banner1 = document.getElementById("banner1");
banner2 = document.getElementById("banner2");
link1 = document.getElementById("link1");
link2 = document.getElementById("link2");

banner1 = document.getElementById("banner1");
banner2 = document.getElementById("banner2");

banner1.style.left = 0;
banner2.style.left = 500;

bannerIndex = 1;

/* Important: In order for this script to work properly, please make sure that the banner graphic and the
URL associated with it have the same index in both, the bannerLocations and bannerURLs arrays.
Duplicate URLs are permitted. */

// Enter the location of the banner graphics in the array below.
bannerLocations = new Array("http://www.smallrain.net/jsimg/pic1.jpg","http://www.smallrain.net/jsimg/pic2.jpg","http://www.smallrain.net/jsimg/pic3.jpg","http://www.smallrain.net/jsimg/pic4.jpg","http://www.smallrain.net/jsimg/pic5.jpg");

// Enter the URL's to which the banners will link to in the array below.
bannerURLs = new Array("http://www.smallrain.net","http://www.smallrain.net","http://www.smallrain.net","http://www.smallrain.net","http://www.smallrain.net");
}
//more javascript from www.smallrain.net
function moveBanner(){
if(!wait){
banner1.style.left = parseInt(banner1.style.left) - (speed * 5);
banner2.style.left = parseInt(banner2.style.left) - (speed * 5);
if(parseInt(banner1.style.left) <= -500){
banner1.style.left = 500;
bannerIndex = (bannerIndex < (bannerLocations.length - 1)) ? ++bannerIndex :0;
banner1.src = bannerLocations[bannerIndex];
link1.href = bannerURLs[bannerIndex];
wait = true;
}
if(parseInt(banner2.style.left) <= -500){
banner2.style.left = 500;
bannerIndex = (bannerIndex < (bannerLocations.length - 1)) ? ++bannerIndex :0;
banner2.src = bannerLocations[bannerIndex];
link2.href = bannerURLs[bannerIndex];
wait = true;
}

setTimeout("moveBanner()",100);
} else {
wait = false;
setTimeout("moveBanner()", displayTime * 1000);
}
}
-->
</script>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<link rel="stylesheet" href="images/CSS.CSS" type="text/css">
<link href="sina.css" rel="stylesheet" type="text/css">
</HEAD>
<body onLoad="initVar(); moveBanner()">

<div align="center">
<div name="addbox" id="addbox">
<a name="link1" id="link1" href="http://www.smallrain.net"><img border="0" name="banner1"

id="banner1" src="http://www.smallrain.net/jsimg/pic1.jpg"></a>
<a name="link2" id="link2" href="http://www.smallrain.net"><img border="0" name="banner2"

id="banner2" src="http://www.smallrain.net/jsimg/pic2.jpg"></a>
</div></div>


</BODY>


</HTML>


面朝大海,春暖花开!
2006-01-13 16:55
快速回复:连续滚动图片问题求助
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015217 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved