1、設計網頁,用滾動字幕顯示為:「xxxx」。 (要求文字上、下、左、右交替滾動)該怎麼寫代碼
上下交替滾動代碼:
<marquee behavior="alternate" direction="down" bgcolor="#aaaaee" align="middle" scrolldelay="120">歡迎您的光臨!</marquee>左右交版替滾動代權碼:
<marquee behavior="alternate" direction="left" bgcolor="#aaaaee" align="middle" scrolldelay="120">歡迎您的光臨!</marquee>2、網頁製作中常用的代碼有?比如說圖片滾動代碼,圖片切換代碼,文字排版代碼等。急需
試試這個圖片切換
有12345數字一起切換
滑鼠點一下數字會變換到另一張圖片,不點就會自動換
裡面有教程和源碼
3、網頁中製作文字與圖片滾動效果
裡面的table自己改
我給你貼代碼
<div id=demo style="overflow:hidden; width:213px; height:100px;"> <div id=demo1>
<table width="336" border="0" cellpadding="0" cellspacing="0">
<%set rs=server.CreateObject("adodb.recordset")
sql="select top 10 * from news where lm2_id=146 order by id desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.Write("<tr><td>無記錄</td></tr>")
else
for i=1 to rs.recordcount%>
<tr>
<td><a href="liang.asp?id=<%=rs("id")%>&lm=<%=Server.URLEncode("重要企業展台")%>"><%=left(rs("subject"),33)%></a>...</td>
</tr>
<%rs.movenext
next
end if%></table></div>
<div id=demo2></div>
</div> <script language="javascript">
var speed=30 // 值越大速度越慢
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetTop-demo.scrollTop<=0)
demo.scrollTop-=demo1.offsetHeight
else{
demo.scrollTop++
}
//上下左右無間隙滾動 最主要是 if 語句的代碼修改
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>
4、如何製作網頁滾動文字
首先讓我們認識這個<marquee>標簽,它是成對出現的標簽,首標簽<marquee>和尾標簽</marquee>之間的內容就是滾動內容。<marquee>標簽的屬性主要有behavior、bgcolor、direction、width、height、hspace、vspace、loop、scrollamount、scrolldelay等,它們都是可選的。
behavior屬性
behavior屬性的參數值為alternate、scroll、slide中的一個,分別表示文字來回滾動、單方向循環滾動、只滾動一次,需要注意的是:如果在<marquee>標簽中同時出現了direction和behavior屬性,那麼scroll和slide的滾動方向將依照direction屬性中參數的設置。如下所示:
<marquee behavior="alternate">我來回滾動</marquee>
我來回滾動
<marquee behavior="scroll">我單方向循環滾動</marquee>
我單方向循環滾動
<marquee behavior="scroll" direction="up" height="30">我改單方向向上循環滾動</marquee>
我改單方向向上循環滾動
<marquee behavior="slide">我只滾動一次</marquee>
我只滾動一次
<marquee behavior="slide" direction="up">我改向上只滾動一次了</marquee>
我改向上滾動一次了
bgcolor屬性
文字滾動范圍的背景顏色,參數值是16進制(形式:#AABBCC或#AA5566等)或預定義的顏色名字(如red、yellow、blue等)。如下所示:
<marquee behavior=="slide" direction="left" bgcolor="red">我的背景色是紅色的</marquee>
我的背景色是紅色的
direction屬性
文字滾動的方向,屬性的參數值有down、left、right、up共四個單一可選值,分別代表滾動方向向下、向左、向右、向上。如下所示:
<marquee direction="right">我向右滾動</marquee>
我向右滾動
<marquee direction="right">我向下滾動</marquee>
我向下滾動
5、Dreamweaver製作網頁時的圖片字體滾動效果怎麼編寫代碼?
1.<marquee onMouseOver=this.stop() onMouseOut=this.start() scrollamount="2" direction="up" behavior="scroll">把你的內容放這里</marquee>這個代碼是比較簡單的示例,會有空白,如果不想有空白的話還是需要JS的。
2.<MARQUEE scrollAmount=1 scrollDelay=1 direction=right width=180 height=250><IMG src="圖片網址" width=180 border=0> <IMG src="圖片網址" width=180 border=0> <IMG src="圖片網址" width=180 border=0> <IMG src="圖片網址" width=180 border=0> <IMG src="圖片網址" width=180 border=0> <IMG src="圖片網址" width=180 border=0>
<DIV></DIV></MARQUEE></CENTER>
數值可以變換,數值的變換可以影響圖片速度的滾動!圖片滾動方向也可以換!都是簡單的英語單詞,大家在變換的時候應該沒有問題
上下滾動圖片代碼:
代碼:<CENTER>
<MARQUEE scrollAmount=1 scrollDelay=1 direction=up width=170 height=250>
<DIV align=center><IMG src="圖片網址" width=300 border=0></DIV>
<DIV align=center><IMG src="圖片網址" width=300 border=0></DIV>
<DIV align=center><IMG src="圖片網址" width=300 border=0></DIV>
<DIV align=center><IMG src="圖片網址" width=300 border=0></DIV>
<DIV align=center><IMG src="圖片網址" width=300 border=0></DIV>
<DIV align=center><IMG src="圖片網址" width=300 border=0></DIV></MARQUEE></CENTER>
註:direction方向 可UP可DOWN 寬高 可以換
6、怎麼製作網頁動態滾動文字...
用marquee即可
比如:
<marquee direction="right" behavior="scroll" scrollamount="10" scrolldelay="200">這是一個滾動字幕</marquee>
在裡面加入marquee裡面加入herf標簽,應該就能實現滾動鏈接裡面添加愛鏈接,marqueen之間也可以和資料庫連接
7、網站設計中,滾動字體的代碼是什麼?上下滾動和左右滾動,詳情代碼設置?謝謝
<marquee onMouseOver=this.stop() onMouseOut=this.start() scrollamount=1 scrolldelay=7 direction=up width=270 height=77> 滾動的文字</marquee>
direction=up(上)down(下)left(左)right(右)
8、網頁設計字體滾動代碼?
文字滾動是由<marquee></marquee>控制的。marquee的參數如下:
1、方向 <direction=#> #=left, right
如:<marquee direction=left>啦啦啦,我從右向左移!</marquee>
<marquee direction=right>啦啦啦,我從左向右移!</marquee>
2、方式 <bihavior=#> #=scroll, slide, alternate
如:<marquee behavior=scroll>啦啦啦,我一圈一圈繞著走!</marquee>
<marquee behavior=slide>啦啦啦,我只走一次就歇了!</marquee>
<marquee behavior=alternate>啦啦啦,我來回走耶!</marquee>
3、循環 <loop=#> #=次數;若未指定則循環不止(infinite)
如:<marquee loop=3 width=50% behavior=scroll>啦啦啦,我只走 3 趟喲!</marquee>
<marquee loop=3 width=50% behavior=slide>啦啦啦,我只走 3 趟喲!</marquee>
<marquee loop=3 width=50% behavior=alternate>啦啦啦,我只走 3 趟喲!</marquee>
4、速度 <scrollamount=#>
如:<marquee scrollamount=20>啦啦啦,我走得好快喲!</marquee>
5、延時 <scrolldelay=#>
如: <marquee scrolldelay=500 scrollamount=100>啦啦啦,我走一步,停一停!</marquee>
6、對齊方式(Align) <align=#> #=top, middle, bottom
如:<font size=6>
<marquee align=# width=400>啦啦啦,我會移動耶!</marquee>
</font>
7、底色 <bgcolor=#>
#=rrggbb 16 進制數碼,或者是下列預定義色彩:
Black, Olive, Teal, Red, Blue, Maroon, Navy, Gray, Lime,
Fuchsia, White, Green, Purple, Silver, Yellow, Aqua
如:<marquee bgcolor=aaaaee>啦啦啦,我會移動耶!</marquee>
8、面積 <height=# width=#>
如:<marquee height=40 width=50% bgcolor=aaeeaa> 啦啦啦,我會移動耶!</marquee>
9、空白(Margins)<hspace=# vspace=#>
<marquee id="scrollarea" direction="up" scrolldelay="10" scrollamount="1" width="150" height="80" onmouseover="this.stop();" onmouseout="this.start();">
------------------------------------------------------------------------------------------------------------------------------
<marquee></marquee>
以下是一個最簡單的例子:
代碼如下:
<marquee><font size=+3 color=red>Hello, World</font></marquee>
下面這兩個事件經常用到:
onMouseOut="this.start()" :用來設置滑鼠移出該區域時繼續滾動
onMouseOver="this.stop()":用來設置滑鼠移入該區域時停止滾動
代碼如下:
<marquee >onMouseOut="this.start()" :用來設置滑鼠移出該區域時繼續滾動 :用來設置滑鼠移入該區域時停止滾動</marquee>
這是一個完整的例子:
代碼如下:
<marquee align="left" behavior="scroll" bgcolor="#FF0000" direction="up" height="300" width="200" hspace="50" vspace="20" loop="-1" scrollamount="10" scrolldelay="100" >
這是一個完整的例子
</marquee>
該標簽支持的屬性多達11個:
align
設定<marquee>標簽內容的對齊方式
absbottom:絕對底部對齊(與g、p等字母的最下端對齊)
absmiddle:絕對中央對齊
baseline:底線對齊
bottom:底部對齊(默認)
left:左對齊
middle:中間對齊
right:右對齊
texttop:頂線對齊
top:頂部對齊
9、如何製作網頁滾動文字
4.3.1 設置文字滾動
HTML技術中使文字滾動的方法是使用雙標簽<marquee></marquee>。在HTML代碼中可使其作用區文字滾動,默認為從右到左,循環滾動。在D:web目錄下創建網頁文件,命名為mar.htm,編寫代碼如代碼4.15所示。
代碼4.15 文字滾動的設置:mar.htm
<html>
<head>
<title>文字滾動的設置</title>
</head>
<body>
<font size="5" color="#cc0000">
文字滾動示例(默認):<marquee>做人要厚道</marquee>
</font>
</body>
</html>
圖4.15 設置文字滾動默認形式
從圖4.15可得,在未設置寬度時,<marquee></marquee>標簽是獨佔一行的。
4.3.2 設置文字滾動的方向
<marquee></marquee>標簽的direction屬性用於設置內容滾動方向,屬性值有left、right、up、down,分別代表向左、向右、向上、向下,例如以下代碼:
<marquee direction="left">做人要厚道</marquee>
<marquee
direction="right">做人要厚道</marquee>
<marquee
direction="up">做人要厚道</marquee>
<marquee
direction="down">做人要厚道</marquee>
4.3.3
設置文字滾動的速度和形式
設置文字滾動使用<marquee></marquee>標簽,其屬性說明如下。
— <marquee></marquee>標簽的scrollamount屬性用於設置內容滾動速度。
—
<marquee></marquee>標簽的behavior
屬性用於設置內容滾動方式,默認為scroll,即循環滾動,當其值為alternate時,內容將來回循環滾動。當其值為slide時,內容滾動一次即停止,不會循環。還有一個loop屬性可設置其滾動循環次數,默認為沒有限制。
— <marquee></marquee>標簽的scrolldelay屬性用於設置內容滾動的時間間隔。
—
<marquee></marquee>標簽的bgcolor屬性用於設置內容滾動背景色(類似於body的背景色設置)。
—
<marquee></marquee>標簽的width 屬性用於設置內容滾動背景寬度。
—
<marquee></marquee>標簽的height屬性用於設置內容滾動背景高度。
修改mar.htm網頁文件,編寫代碼如代碼4.16所示。
代碼4.16 文字滾動的設置:mar.htm
<html>
<head>
<title>文字滾動的設置</title>
</head>
<body>
<font size="3" color="#cc0000">
文字滾動示例(默認):<marquee>做人要厚道</marquee>
文字滾動示例(向右):<marquee
direction="right" scrolldelay="500">做人要厚道</marquee>
文字滾動示例(向下,滾動方式為slide,速度為10):<marquee scrollamount="10"
behavior="slide">做人要厚道</marquee>
文字滾動示例(默認方向,滾動方式為alternate,循環3次,速度為2):<marquee scrollamount="2"
behavior="alternate" loop="3">做人要厚道</marquee>
文字滾動示例(向上,背景色為#CCFF66,設置了背景寬度和高度):<marquee direction="up"
bgcolor="#CCFF66" width="250" height="55">做人要厚道</marquee>
</font>
</body>
</html>
在瀏覽器地址欄輸入http://localhost/mar.htm,瀏覽效果如圖4.16所示。
圖4.16 文字滾動的不同形式
<marquee></marquee>的眾多屬性能非常方便地製作滾動文字,在後面的JavaScript學習中,讀者將繼續深化<marquee></marquee>標簽的動態行為學習。