導航:首頁 > 萬維百科 > 網頁設計圖片滾動代碼

網頁設計圖片滾動代碼

發布時間:2021-01-22 12:23:19

1、網頁製作 圖片滾動

<marquee direction=up height=75 onMouseOut=this.start() onMouseOver=this.stop() scrollamount=1 scrolldelay=100 width="180" id=MARQUEE1>滾動內容</marquee>

Direction 參數可設置:up down left right (控制滾動方向)

Scrolldelay = 100 (100就是速度,值越大滾動越快……)

onMouseOut=this.start() ........滑鼠移出狀態滾動

onMouseOver=this.stop() .........滑鼠經過時停止滾動

基本語法
<marquee> ... </marquee>
移動屬性的設置 ,這種移動不僅僅局限於文字,也可以應用於圖片,表格等等

方向
<direction=#> #=left, right ,up ,down <marquee direction=left>從右向左移!</marquee>

方式
<bihavior=#> #=scroll, slide, alternate <marquee behavior=scroll>一圈一圈繞著走!</marquee>
<marquee behavior=slide>只走一次就歇了!</marquee>
<marquee behavior=alternate>來回走</marquee>

循環
<loop=#> #=次數;若未指定則循環不止(infinite) <marquee loop=3 width=50% behavior=scroll>只走 3 趟</marquee> <P>
<marquee loop=3 width=50% behavior=slide>只走 3 趟</marquee>
<marquee loop=3 width=50% behavior=alternate>只走 3 趟!</marquee>

速度
<scrollamount=#> <marquee scrollamount=20>啦啦啦,我走得好快喲!</marquee>

延時
<scrolldelay=#> <marquee scrolldelay=500 scrollamount=100>啦啦啦,我走一步,停一停!</marquee>

外觀(Layout)設置

對齊方式(Align)
<align=#> #=top, middle, bottom <font size=6>
<marquee align=# width=400>啦啦啦,我會移動耶!</marquee>
</font>

底色
<bgcolor=#> #=rrggbb 16 進制數碼,或者是下列預定義色彩:
Black, Olive, Teal, Red, Blue, Maroon, Navy, Gray, Lime,
Fuchsia, White, Green, Purple, Silver, Yellow, Aqua <marquee bgcolor=aaaaee>顏色!</marquee>

面積
<height=# width=#> <marquee height=40 width=50% bgcolor=aaeeaa>面積!</marquee>

空白
(Margins)<hspace=# vspace=#>
<marquee hspace=20 vspace=20 width=150 bgcolor=ffaaaa align=middle>面積!</marquee>

2、網頁中的滾動圖片的代碼怎麼寫?

網頁中的滾動圖片的代碼有上下左右四個方向,分別是:

<head>

<----->

</head>

<body>

<!--向上滾動代碼開始-->

<div id="colee" style="overflow:hidden;height:253px;width:410px;">

<div id="colee1">

<p><img src=""></p>

<p><img src=""></p>

<p><img src=""></p>

<p><img src=""></p>

<p><img src=""></p>

<p><img src=""></p>

<p><img src=""></p>

<p><img src=""></p>

<p><img src=""></p>

</div>

<div id="colee2"></div>

</div>

<script>

var speed=30;

var colee2=document.getElementById("colee2");

var colee1=document.getElementById("colee1");

var colee=document.getElementById("colee");

colee2.innerHTML=colee1.innerHTML; //克隆colee1為colee2

function Marquee1(){

//當滾動至colee1與colee2交界時

if(colee2.offsetTop-colee.scrollTop<=0){

 colee.scrollTop-=colee1.offsetHeight; //colee跳到最頂端

 }else{

 colee.scrollTop++

}

}

var MyMar1=setInterval(Marquee1,speed)//設置定時器

//滑鼠移上時清除定時器達到滾動停止的目的

colee.onmouseover=function() {clearInterval(MyMar1)}

//滑鼠移開時重設定時器

colee.onmouseout=function(){MyMar1=setInterval(Marquee1,speed)}

</script>

<!--向上滾動代碼結束-->

<!--下面是向下滾動代碼-->

<div id="colee_bottom" style="overflow:hidden;height:253px;width:410px;">

<div id="colee_bottom1">

<p><img src="/jscss/demoimg/200907/bg3.jpg"></p>

<p><img src="/jscss/demoimg/200907/bg3.jpg"></p>

<p><img src="/jscss/demoimg/200907/bg3.jpg"></p>

<p><img src="/jscss/demoimg/200907/bg3.jpg"></p>

<p><img src="/jscss/demoimg/200907/bg3.jpg"></p>

<p><img src="/jscss/demoimg/200907/bg3.jpg"></p>

<p><img src="/jscss/demoimg/200907/bg3.jpg"></p>

<p><img src="/jscss/demoimg/200907/bg3.jpg"></p>

<p><img src="/jscss/demoimg/200907/bg3.jpg"></p>

</div>

<div id="colee_bottom2"></div>

</div>

<script>

var speed=30

var colee_bottom2=document.getElementById("colee_bottom2");

var colee_bottom1=document.getElementById("colee_bottom1");

var colee_bottom=document.getElementById("colee_bottom");

colee_bottom2.innerHTML=colee_bottom1.innerHTML

colee_bottom.scrollTop=colee_bottom.scrollHeight

function Marquee2(){

if(colee_bottom1.offsetTop-colee_bottom.scrollTop>=0)

colee_bottom.scrollTop+=colee_bottom2.offsetHeight

else{

colee_bottom.scrollTop--

}

}

var MyMar2=setInterval(Marquee2,speed)

colee_bottom.onmouseover=function() {clearInterval(MyMar2)}

colee_bottom.onmouseout=function() {MyMar2=setInterval(Marquee2,speed)}

</script>

<!--向下滾動代碼結束-->

<div id="colee_left" style="overflow:hidden;width:500px;">

<table cellpadding="0" cellspacing="0" border="0">

<tr><td id="colee_left1" valign="top" align="center">

<table cellpadding="2" cellspacing="0" border="0">

<tr align="center">

<td><p><img src="/jscss/demoimg/200907/bg3.jpg"></p></td>

<td><p><img src="/jscss/demoimg/200907/bg3.jpg"></p></td>

<td><p><img src="/jscss/demoimg/200907/bg3.jpg"></p></td>

<td><p><img src="/jscss/demoimg/200907/bg3.jpg"></p></td>

<td><p><img src="/jscss/demoimg/200907/bg3.jpg"></p></td>

<td><p><img src="/jscss/demoimg/200907/bg3.jpg"></p></td>

<td><p><img src="/jscss/demoimg/200907/bg3.jpg"></p></td>

</tr>

</table>

</td>

<td id="colee_left2" valign="top"></td>

</tr>

</table>

</div>

<script>

//使用div時,請保證colee_left2與colee_left1是在同一行上.

var speed=30//速度數值越大速度越慢

var colee_left2=document.getElementById("colee_left2");

var colee_left1=document.getElementById("colee_left1");

var colee_left=document.getElementById("colee_left");

colee_left2.innerHTML=colee_left1.innerHTML

function Marquee3(){

if(colee_left2.offsetWidth-colee_left.scrollLeft<=0)//offsetWidth 是對象的可見寬度

colee_left.scrollLeft-=colee_left1.offsetWidth//scrollWidth 是對象的實際內容的寬,不包邊線寬度

else{

colee_left.scrollLeft++

}

}

var MyMar3=setInterval(Marquee3,speed)

colee_left.onmouseover=function() {clearInterval(MyMar3)}

colee_left.onmouseout=function() {MyMar3=setInterval(Marquee3,speed)}

</script>

<!--向左滾動代碼結束-->


<!--下面是向右滾動代碼-->

<div id="colee_right" style="overflow:hidden;width:500px;">

<table cellpadding="0" cellspacing="0" border="0">

<tr><td id="colee_right1" valign="top" align="center">

<table cellpadding="2" cellspacing="0" border="0">

<tr align="center">

<td><p><img src="/jscss/demoimg/200907/bg3.jpg"></p></td>

<td><p><img src="/jscss/demoimg/200907/bg3.jpg"></p></td>

<td><p><img src="/jscss/demoimg/200907/bg3.jpg"></p></td>

<td><p><img src="/jscss/demoimg/200907/bg3.jpg"></p></td>

<td><p><img src="/jscss/demoimg/200907/bg3.jpg"></p></td>

</tr>

</table>

</td>

<td id="colee_right2" valign="top"></td>

</tr>

</table>

</div>

<script>

var speed=30//速度數值越大速度越慢

var colee_right2=document.getElementById("colee_right2");

var colee_right1=document.getElementById("colee_right1");

var colee_right=document.getElementById("colee_right");

colee_right2.innerHTML=colee_right1.innerHTML

function Marquee4(){

if(colee_right.scrollLeft<=0)

colee_right.scrollLeft+=colee_right2.offsetWidth

else{

colee_right.scrollLeft--

}

}

var MyMar4=setInterval(Marquee4,speed)

colee_right.onmouseover=function() {clearInterval(MyMar4)}

colee_right.onmouseout=function() {MyMar4=setInterval(Marquee4,speed)}

</script>

<!--向右滾動代碼結束-->

(2)網頁設計圖片滾動代碼擴展資料:

代碼就是程序員用開發工具所支持的語言寫出來的源文件,是一組由字元、符號或信號碼元以離散形式表示信息的明確的規則體系。代碼設計的原則包括唯一確定性、標准化和通用性、可擴充性與穩定性、便於識別與記憶、力求短小與格式統一以及容易修改等。 源代碼是代碼的分支,某種意義上來說,源代碼相當於代碼。

現代程序語言中,源代碼可以書籍或磁帶形式出現,但最為常用格式是文本文件,這種典型格式的目的是為了編譯出計算機程序。計算機源代碼最終目的是將人類可讀文本翻譯成為計算機可執行的二進制指令,這種過程叫編譯,它由通過編譯器完成。

源代碼(也稱源程序),是指一系列人類可讀的計算機語言指令。

源代碼是相對目標代碼和可執行代碼而言的。 源代碼就是用匯編語言和高級語言寫出來的地代碼。目標代碼是指源代碼經過編譯程序產生的能被cpu直接識別二進制代碼。可執行代碼就是將目標代碼連接後形成的可執行文件,當然也是二進制的。

在現代程序語言中,源代碼可以是以書籍或者磁帶的形式出現,但最為常用的格式是文本文件,這種典型格式的目的是為了編譯出計算機程序。計算機源代碼的最終目的是將人類可讀的文本翻譯成為計算機可以執行的二進制指令,這種過程叫做編譯,通過編譯器完成。

參考資料:網路-計算機代碼

3、網頁製作怎樣讓圖片滾動?

網頁圖片無縫滾動實現代碼:
<style type="text/css">
<!--
ul,li,div{margin:0; padding:0; font-size:12px;}
#demo {
width:678px; float:right; overflow:hidden;height:144px; border:none;
}
#indemo {
float: left;
width: 800%;
}
#demo1,#demo2{height:144px;float:left; display:inline-table;}
#demo1 li,#demo2 li{ width:127px; height:144px; float:left; padding-left:8px; }
#demo1 li img,#demo2 li img{ display:block; background:#ccc; padding:1px; border:1px solid #ccc;}
#demo1 li span,#demo2 li span{ width:127px; height:30px; line-height:30px; text-align:center; overflow:hidden;}
#demo1 {
float: left;
}
#demo2 {
float: left;
}
-->
</style>
<div id="demo">
<div id="indemo">
<div id="demo1">
<ul>
<li><a href="#"><img src="http://boaer.comimg/temp01.gif" width="123" height="110" /></a><span><a href="#">產品名稱</a></span></li>
<li><a href="#"><img src="http://boaer.comimg/temp02.gif" width="123" height="110" /></a><span><a href="#">產品名稱</a></span></li>
<li><a href="#"><img src="http://boaer.comimg/temp03.gif" height="110" /></a><span><a href="#">產品名稱</a></span></li>
</ul></div><div id="圖片展示代碼例子"></div></div></div><script>
<!--
var speed=20; //數字越大速度越慢
var tab=document.getElementById("demo");
var tab1=document.getElementById("demo1");
var tab2=document.getElementById("demo2");
tab2.innerHTML=tab1.innerHTML;
function Marquee(){
if(tab2.offsetWidth-tab.scrollLeft<=0)
tab.scrollLeft-=tab1.offsetWidth
else{
tab.scrollLeft++;
}
}
var MyMar=setInterval(Marquee,speed);
tab.onmouseover=function() {clearInterval(MyMar)};
tab.onmouseout=function() {MyMar=setInterval(Marquee,speed)};
-->
</script></td>
</tr>
</table>

4、如何在網頁製作中將圖片設置為滾動

1、素材的准備。為了更好的表現網站的風格和特色,具備一些更富表現力和吸引力的圖片是必不可少的;

2、在電腦上找到並且打開Dreamweaver8,重新建立一個網頁文件,並且把網頁文件保存,且命名為「index.html"文件;

3、在完成網頁文件保存和命名為「index.html"文件以後,切換至代碼編輯界面,輸入相應的程序代碼;

4、新建一CSS樣式表文件,並將該文件保存到與「index.html」相同的目錄下,文件名稱為「MyStyle.css";

5、在樣式表文件"MyStyle.css」文件的完成以後,打開樣式表文件"MyStyle.css」文件輸入相應的程序代碼;

6、在網頁文件"index.html"中添加對該樣式表的引用:「<link rel="stylesheet" type="text/css" href="MyStyle.css">」,同時新建一個JS文件,並將該文件另存為「MoveEffect.js";

7、在JS文件」MoveEffect.js「文件建立完成以後,同樣打開JS文件」MoveEffect.js「文件輸入程序的代碼;

8、完成上述程序運行以後,在主頁文件"index.html」中添加對該「MoveEffect.js」文件的引用,「<script type="text/javascript" src="MoveEffect.js"></script>」,打開「index.html」網頁文件即可。

5、網頁製作中常用的代碼有?比如說圖片滾動代碼,圖片切換代碼,文字排版代碼等。急需

試試這個圖片切換

有12345數字一起切換

滑鼠點一下數字會變換到另一張圖片,不點就會自動換

裡面有教程和源碼

6、網頁製作中 無限循環滾動的圖片代碼

我自己用jquery寫的縱向的,想要橫向的我可以幫你改改。
<!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>無標題文檔</title>
<script language="javascript" src="jquery.js"></script>
<script language="javascript">
$(document).ready(function() {
var height = $("ul li").height();
var ul = $("ul");
var picTimer;
var btn = "<div class='scroll_btn pre'></div><div

class='scroll_btn next'></div>";
//$("ul").append(btn);
$("ul").hover(function() {
clearInterval(picTimer);
},function() {
picTimer = setInterval(
function() {
var field = $("ul

li:first");
field.animate

({marginTop:-height+'px'},600,function(){
field.appendTo

(ul).css('marginTop',0);
})
},3000
);
}).trigger("mouseleave");
//下一個需要 研究
$(".pre").click(function() {
var field = $("ul li:first");
var lastField = $("ul li:last");
field.animate({marginTop:height

+'px'},600,function(){
lastField.insertBefore(field);
});
});

$(".next").click(function() {
var field = $("ul li:first");
field.animate

({marginTop:-height+'px'},600,function(){
field.appendTo

(ul).css('marginTop',0);
}) ;
});
});
</script>
<style type="text/css">
* { margin:0px; padding:0px;}
ul { width:200px; height:200px; border:1px solid #030;

position:relative; overflow:hidden;}
li { list-style:none; width:200px; height:200px; display:block;}
.scroll_btn { width:100px; height:20px; position:absolute;

background:#000; z-index:100}
.pre { left:10px; top:10px;}
.next { left:10px; bottom:10px;}
</style>
</head>

<body>
<ul>
<li style="background:red"></li>
<li style="background:green"></li>
<li style="background:blue"></li>
<li style="background:yellow"></li>
</ul>
</body>
</html>
記得:<script language="javascript" src="jquery.js"></script>
載入jquery工程 才能看效果

7、求網頁設計中滾動圖片代碼

留郵箱,我明天上班發給你,我收集了很多js滾動焦點圖的代碼,還有其他的一些網頁效果,再給你推薦一個網站:站酷,這個網站做的很好看,裡面的素材也是相當的好,建議你去逛逛,裡面一定有你需要的東西!

8、Dreamweaver製作圖片左右滾動的完整代碼怎麼編寫?

<marquee><img src="圖片地址"></marquee>

使用這個代碼就可以了,而且可以稍微修改下的。


<marquee>標簽是滾動字幕標簽,裡面可以嵌套很多標簽,比如<p>標簽、<a>標簽、<img>標簽,我給你的這個代碼就是嵌套<img>標簽的應用 左右滾動可以


以下是這個標簽的參數:

(1)scrollAmount:它表示速度,值越大速度越快。如果沒有它,默認為6,建議設為1~3比較好。

(2)width和height:表示滾動區域的大小,width是寬度,height是高度。特別是在做垂直滾動的時候,一定要設height的值。 

(3)direction:表示滾動的方向,默認為從右向左(left):可選的值有right、down、up。

9、網頁設計 請問這個滾動圖片的代碼是什麼?

直接給你鏈接地址,你自己看
http://www.divcss5.com/css-texiao/texiao269.shtml

與網頁設計圖片滾動代碼相關的知識