GoldPage1

logo

Tin đề xuất

Sự kiện tiêu biểu

Tạo ảnh bay từ trái sang phải

(Blogtamsu) - DÁn code sau vào thẻ <BODY> <body onload="Ypick()"> <script language="VBScript"> on error resume next ....

https://nhipsong24vn.blogspot.com/ - Chuyên nhận rip, thiết kế, cung cấp: Template blogspot, template blogger chuẩn SEO, Tối ưu website, tích hợp tin tức, giỏ hàng cho blogger bán hàng...

DÁn code sau vào thẻ <BODY>


<body onload="Ypick()">
<script language="VBScript">
on error resume next
if parent.navButtonStatus <> 3 then
if err.number <> 0 then
call parent.ThereIsAnError
end if
end if
</script>
<script language="JavaScript">

/*
Flying Image Script-
By Dylan Coldblatt (codeboy14@yahoo.com)
Submitted to Dynamicdrive.com for featuring in it's archive
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/

var yend;
var ystart;
var ydiff;
var xincrement;
var yincrement;
var screenwidth;
var screenheight;

function Ypick(){

if (!document.all)
return
screenwidth = screensize.offsetWidth;
screenheight = screensize.offsetHeight;
xincrement = (screenwidth/10);
ystart = Math.round(Math.random()*(screenheight-92));
yend = Math.round(Math.random()*(screenheight-92));
document.all.ball.style.top=ystart;
document.all.ball.style.left=-100;
if (ystart > yend){
ydiff = (ystart-yend);
yincrement = (ydiff/xincrement);
Moveneg();
}
else {
ydiff = (yend-ystart);
yincrement = (ydiff/xincrement);
Movepos();
}
}
function Moveneg(){
if (screenwidth > parseInt(document.all.ball.style.left)) {
with (document.all.ball) {
style.left = parseInt(style.pixelLeft + 10);
style.top = parseInt(style.pixelTop - yincrement);
}
setTimeout('Moveneg()',20);
}
else {
with (document.all.ball) {
style.left = parseInt(style.pixelLeft - screenwidth);
style.top = parseInt(style.pixelTop - yend);
}
Ypick();
}
}
function Movepos(){
if (screenwidth > parseInt(document.all.ball.style.left)) {
with (document.all.ball) {
style.left = parseInt(style.pixelLeft + 10);
style.top = parseInt(style.pixelTop + yincrement);
}
setTimeout('Movepos()',20);
}
else {
with (document.all.ball) {
style.left = parseInt(style.pixelLeft - screenwidth);
style.top = parseInt(style.pixelTop - yend);
}
Ypick();
}
}
</script>
<div id="screensize" style="position: absolute; top: 0; left: 0; height: 100%; width: 100%"></div>
<p><img id="ball" SRC="http://dynamicdrive.com/plane.gif" style="container:in-flow;position:relative;left:-100;top:0;visibility:show">




Sau đó sữa thẻ body thành <body onload="Ypick()">.Code ở trên tôi sữa sẵng rồi các bạn cứ việc copy vào là chạy.Và cần phải sữa http://dynamicdrive.com/plane.gif thành ảnh của bạn nữa chứ .
BẠn xem thử tại đây http://www.dynamicdrive.com/dynamicindex4/xoomimage.htm

Chúc bạn thành công!

Xem thêm>>

Xem thêm>>

Đóng liên hệ [x]
hotline0918