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

如何做圖片滾動代碼

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



效果:

閱讀全文

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

熱點內容
arcgis怎麼存儲為圖片 瀏覽:249
男生背影插畫圖片 瀏覽:497
男生卡通唯美頭像帶字圖片 瀏覽:415
元旦節的簡單畫圖片 瀏覽:206
女生吃辣條的樣子圖片 瀏覽:333
矮胖子穿衣服搭配圖片 瀏覽:334
初三女生的腋毛圖片 瀏覽:409
圖片提取文字美圖秀秀 瀏覽:947
上海外灘小女孩小便圖片 瀏覽:362
三年級的文字卡通圖片 瀏覽:576
word多張圖片垂直居中 瀏覽:934
小女生的名字大全圖片 瀏覽:308
女生外套動漫圖片 瀏覽:169
如何把圖片置入word文本 瀏覽:265
關於懶的圖片可愛哈士奇 瀏覽:745
古井鳳酒圖片價格 瀏覽:105
別墅院子門樓圖片大全 瀏覽:595
真豬的圖片可愛 瀏覽:27
關於護士的小可愛圖片 瀏覽:720
姚笛發型圖片 瀏覽:656