導航:首頁 > 圖片大全 > 如何做圖片滾動代碼

如何做圖片滾動代碼

發布時間:2024-01-21 10:55:53

A. 如何用html實現文本+圖片輪流滾動顯示

就是無縫滾動

用js就可以

1、打開Dreamweaver軟體

2、代碼如下: 不要忘了引入js庫


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>js無縫滾動製作js文字無縫滾動和js圖片無縫滾動</title>

<meta name="description" content="js無縫滾動製作多種無縫滾動效果js文字無縫滾動和js圖片無縫滾動,直接復制副本標簽js無縫滾動代碼。內含js代碼下載。" />

</head>


<body>

<style type="text/css">

*{margin:0;padding:0;list-style-type:none;font-size:12px;}

a,img{border:0;}


.scroll{height:300px;width:500px;margin:50px auto;border:solid 1px #ddd;}

.scroll p{line-height:28px;padding:5px 0;border-bottom:dashed 1px #ddd;text-align:center;}

.scroll p a{color:#3366cc;text-decoration:none;}

</style>


<script type="text/javascript">

function addEventSimple(obj,evt,fn){

if(obj.addEventListener){

obj.addEventListener(evt,fn,false);

}else if(obj.attachEvent){

obj.attachEvent('on'+evt,fn);

}

}


addEventSimple(window,'load',initScrolling);


var scrollingBox;

var scrollingInterval;

var reachedBottom=false;

var bottom;


function initScrolling(){

scrollingBox = document.getElementById('xst');

scrollingBox.style.overflow = "hidden";

scrollingInterval = setInterval("scrolling()",50);

scrollingBox.onmouseover = over;

scrollingBox.onmouseout = out;

}


function scrolling(){

var origin = scrollingBox.scrollTop++;

if(origin == scrollingBox.scrollTop){

if(!reachedBottom){

scrollingBox.innerHTML+=scrollingBox.innerHTML;

reachedBottom=true;

bottom=origin;

}else{

scrollingBox.scrollTop=bottom;

}

}

}


function over(){

clearInterval(scrollingInterval);

}

function out(){

scrollingInterval = setInterval("scrolling()",50);

}

</script>



<div class="scroll" id="xst">

<p><a href="http://www.17sucai.com/" target="_blank">jquery 文字滾動大全 scroll 支持文字或圖片 單行滾動 多行滾動 帶按鈕控制滾動</a></p>

<p><img width="150" height="150" alt="jquery 文字滾動大全 scroll 支持文字或圖片 單行滾動 多行滾動 帶按鈕控制滾動" src="images/1.jpg" /></p>

<p><a href="http://www.17sucai.com/" target="_blank">jquery 文字連續滾動 節奏感十足的齒輪式滾動圖片展示與文字內容特效展示</a></p>

<p><img width="150" height="150" alt="js文字滾動製作js scroll單排文字滾動向上間隔滾動" src="images/2.jpg" /></p>

<p><a href="http://www.17sucai.com/" target="_blank">jquery 文字特效霓虹燈文字效果使用jQuery和CSS</a></p>

<p><img width="150" height="150" alt="jquery 文字連續滾動 節奏感十足的齒輪式滾動圖片展示與文字內容特效展示" src="images/3.jpg" /></p>

<p><a href="http://www.17sucai.com/" target="_blank">js文字滾動製作js scroll單排文字滾動向上間隔滾動</a></p>

<p><img width="150" height="150" alt="jquery 文字特效霓虹燈文字效果使用jQuery和CSS" src="images/4.jpg" /></p>

<p><a href="http://www.17sucai.com/" target="_blank">js文字切換特效製作焦點文字帶濾鏡切換效果</a></p>

<p><a href="http://www.17sucai.com/" target="_blank">js文字特效製作js文字閃爍與文字變色效果</a></p>

<p><a href="http://www.17sucai.com/" target="_blank">js文字滾動插件製作雙行關聯向上文字間隙滾動</a></p>

</div>


</body>



效果:

閱讀全文

與如何做圖片滾動代碼相關的資料

熱點內容
十二節氣手抄報圖片簡單詩詞 瀏覽:680
維多利亞短發發型圖片 瀏覽:886
抑鬱症男生動作圖片 瀏覽:631
祖孫三人高清圖片 瀏覽:89
穿長筒襪圖片女孩 瀏覽:465
清新綠色衣服圖片 瀏覽:653
可愛金毛圖片 瀏覽:938
兩個高中男生同框圖片 瀏覽:607
學習的手抄報簡單漂亮圖片 瀏覽:504
如何選中裁剪後的圖片 瀏覽:169
天安門的圖片素材高清 瀏覽:912
發型男兩邊剃光圖片 瀏覽:240
圖片變word文檔 瀏覽:354
如何讓圖片復制不了 瀏覽:210
美女帶墨鏡圖片 瀏覽:898
男生煮麵圖片搞笑 瀏覽:764
姓氏賈圖片文字 瀏覽:50
18歲以上男生的圖片 瀏覽:272
圖片大全可愛小孩卡通 瀏覽:765
不公平字體的高清唯美圖片 瀏覽:749