Marquee Codes
Horizontal Marquee
Marquee đang di chuyển theo chiều ngang từ phải sang trái. Mặc dù điều này có xu hướng là mặc định,
direction="left" . Bạn có thể thiết lập nó sang right, up, and down .
(Chưa có time để dịch , hi!)
| Source Code | Demo |
|---|---|
<marquee behavior="scroll" direction="left">
Text tại đây </marquee> |
Bạn có thể tăng tốc độ hoặc làm chậm các vùng chọn của bạn bằng cách sử dụng các thuộc tính scrollamount cùng với một giá trị số. Ở đây, chúng tôi sử dụng một số giá trị để thiết lập vùng chọn tốc độ khác nhau.
| Source Code | Demo |
|---|---|
<marquee behavior="scroll" direction="right" scrollamount="5">Tortoise</marquee> <marquee behavior="scroll" direction="right" scrollamount="1">Snail</marquee> |
There's nothing to stop you putting more than one HTML element inside your HTML marquee codes. Doing so will make both scroll.
| Source Code | Demo |
|---|---|
<div style="text-align:center;"> <img src="http://www.htmlcodes.me/images/marquees/flying_bat.gif" width="125" height="82" alt="Flying bat in a marquee" /><br />Bruce the Bat </div> </marquee> |
onmouseover="this.stop();"
(i.e.
onmouseout="this.start();")| Source Code | Result |
|---|---|
| <marquee behavior="alternate" scrollamount="30" onmousedown="this.stop();" onmouseup="this.start();"> Go on... STOP ME! </marquee> |
Stop Marquee with Buttons
onClick="document.getElementById('mymarquee').stop();"
onClick="document.getElementById('mymarquee').start();"
Demo
Code
<marquee behavior="scroll" direction="left" scrollamount="50" id="mymarquee">
<p>See how fast I am!</p>
</marquee>
<input type="button" value="Stop Marquee" onClick="document.getElementById('mymarquee').stop();">
<input type="button" value="Start Marquee" onClick="document.getElementById('mymarquee').start();">
with image
Demo
Code
<marquee behavior="scroll" direction="right" scrollamount="50" id="mymarquee2">
<p>See how fast I am!</p>
</marquee>
<img src="http://www.htmlcodes.me/images/marquees/stop_marquee.png" width="100" height="100" alt="Stop button" onClick="document.getElementById('mymarquee2').stop();" />
<img src="http://www.htmlcodes.me/images/marquees/start_marquee.png" width="100" height="100" alt="Start button" onClick="document.getElementById('mymarquee2').start();" />
Marquee Attributes
Danh sách thuộc tính
width | Chiều rộng của marquee | scrollamount | How far to jump as it moves |
height | Chiều cao của marquee | loop | How many times it should loop |
direction | Hướng chạy marquee | bgcolor | Màu nền marquee |
behavior | Kiểu chạy: slide, bounce, scroll | hspace | Sets the amount of horizontal space around the marquee |
scrolldelay | How long the marquee should wait before each jump | vspace | Sets the amount of vertical space around the marquee |
Nguồn: HTMLcode
















0 Nhận xét:
Đăng nhận xét