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

如何做圖片滾動代碼

發布時間: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>



效果:

閱讀全文

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

熱點內容
凱蒂貓蛋糕圖片大全 瀏覽:538
考古墓主衣服圖片 瀏覽:555
今日頭條如何改圖片大小 瀏覽:747
word如何插入能移動的圖片 瀏覽:169
平湖網站製作圖片上如何顯示文字 瀏覽:29
男生從背後擁抱女生的圖片對鏡 瀏覽:966
word怎麼調整圖片大小到指定尺寸 瀏覽:474
word編輯批量圖片教程 瀏覽:35
美女的球圖片 瀏覽:43
笑一笑圖片文字 瀏覽:139
發型男潮流圖片 瀏覽:924
word里組合圖片怎麼壓縮 瀏覽:603
帶藍色花衣服圖片 瀏覽:497
淑字圖片大全 瀏覽:229
照冊里圖片如何隱藏還原 瀏覽:596
幼兒給蘋果樹卸袋的簡單圖片 瀏覽:245
漂亮身材好女生圖片 瀏覽:356
快手高質量圖片女生 瀏覽:311
惡魔可愛圖片手繪 瀏覽:904
去除圖片中的文字 瀏覽:868