Web page floating Ads JS code

Source: Internet
Author: User
Keywords Web page production Ajax javascript
Tags ajax code default document function http javascript script

<div id= "ad" style= "Position:absolute" >
<a href= "http://www.jzread.com/" target= "_blank" >
<img src= "http://www.jzread.com/skin/default/imga/w300ad.gif" border= "0" >
</a>
</div>
<script>
var x = 300,y = 144
var xin = true, Yin = True
var step = 1
var delay = ten
var obj=docu Ment.getelementbyid ("ad")
function Floatad () {
var l=t=0
var r= document.body.clientwidth-obj.offsetwidth
var B = document.body.clientheight-obj.offsetheight
Obj.style.left = x + document.body.scrollLeft
Obj.style.top = y + document.body.scrollTop
x = x + step* (xin?1:-1)
if (x < L) {Xin = true; x = L}
if (x > R) { Xin = false; x = R}
y = y + step* (yin?1:-1)
if (Y < T) {Yin = true; y = T}
if (Y > B) {yin = false; y = b}
}
V Ar itl= setinterval ("Floatad ()", delay)
Obj.onmouseover=function () {clearinterval (ITL)}
obj.onmouseout= function () {Itl=sEtinterval ("Floatad ()", delay)}
</script>
<script language=javascript>
<!--
if ( self.name== ' main ') top.location = "index.php";

var alertinput = "Please enter: NN";
function Login (form) {
var mesg = "";
if (Form.log_user.value = = "") MESG + = "User n";
if (Form.log_pwd.value = = "") MESG + + = "Password n";
if (MESG!= "") {
MESG = Alertinput + mesg;
alert (MESG);
return false;
}
Form.submit ();
}

function Chk_enterkey (form) {
if (window.event.keycode==13) {
Login (form);
}
}
-->
</SCRIPT>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.