marquee標籤、插入百度地圖

<marquee></marquee>能夠實現多種滾動效果,無需js控制。css

使用marquee標記不只能夠移動文字,也能夠移動圖片,表格等.html

語法:<marquee>...</marquee>; 說明:在標記之間添加要進行滾動的內容。api

重要屬性:ide

1.滾動方向direction(包括4個值:up、 down、 left和 right)oop

  語法:<marquee direction="滾動方向">...</marquee>ui

2.滾動方式behavior(scroll:循環滾動,默認效果; slide:只滾動一次就中止; alternate:來回交替進行滾動)spa

  語法:<marquee behavior="滾動方式">...</marquee>code

3.滾動速度scrollamount(滾動速度是設置每次滾動時移動的長度,以像素爲單位)xml

  語法:<marquee scrollamount="5">...</marquee>htm

4.滾動延遲scrolldelay(設置滾動的時間間隔,單位是毫秒)

  語法:<marquee scrolldelay="100">...</marquee>

5.滾動循環loop(默認值是-1,滾動會不斷的循環下去)

  語法:<marquee loop="2">...</marquee>

6.滾動範圍width、height

7.滾動背景顏色bgcolor

8.空白空間hspace、vspace

但marquee標籤沒法實現無縫輪播 下面是用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>無標題文檔</title>
<style type="text/css">
    html,body{margin:0;padding:0;}
    .iw_poi_title {color:#CC5522;font-size:14px;font-weight:bold;overflow:hidden;padding-right:13px;white-space:nowrap}
    .iw_poi_content {font:12px arial,sans-serif;overflow:visible;padding-top:4px;white-space:-moz-pre-wrap;word-wrap:break-word}
</style>
</head>

<body>
<div id="butong_net_right" style="overflow:hidden;width:700px;">
<table cellpadding="0" cellspacing="0" border="0">
<tr><td id="butong_net_right1" valign="top" align="center">
<table cellpadding="2" cellspacing="0" border="0">
<tr align="center">
<td><img src="n0.jpg" width="100" height="133"></td>
<td><img src="n0.jpg" width="100" height="133"></td>
<td><img src="n0.jpg" width="100" height="133"></td>
<td><img src="n0.jpg" width="100" height="133"></td>
<td><img src="n0.jpg" width="100" height="133"></td>
</tr>
</table>
</td>
<td id="butong_net_right2" valign="top"></td>
</tr>
</table>
 </div>    
</body>
</html>
<script>
var speed=30//速度數值越大速度越慢
butong_net_right2.innerHTML=butong_net_right1.innerHTML
function Marquee4(){
if(butong_net_right.scrollLeft<=0)
butong_net_right.scrollLeft+=butong_net_right2.offsetWidth
else{
butong_net_right.scrollLeft--
}
}
var MyMar4=setInterval(Marquee4,speed)
butong_net_right.onmouseover=function() {clearInterval(MyMar4)}
butong_net_right.onmouseout=function() {MyMar4=setInterval(Marquee4,speed)}
</script>  

插入百度地圖:

進入http://api.map.baidu.com/lbsapi/creatmap/index.html

而後根據本身需求設置地圖的定位和樣式、也能夠添加自定義標註

單擊獲取代碼便可

相關文章
相關標籤/搜索