Floating ad code on both sides of the Web

Source: Internet
Author: User
Tags eval split visibility window
Floating | advertising | Web page Add the following code to the body:
"< DIV id=floater1 style=" Z-INDEX:100; left:10px; visibility:visible; width:100px; Position:absolute; top:160px; height:100px; ">
The left side of the thing, can be a picture, table
</div >
< DIV id=floater style= "Z-INDEX:100; right:10px; visibility:visible; width:100px; Position:absolute; top:160px; left:890px; ">
The right side of the thing, can be a picture, table
</div > "
The code for Menus.js is as follows:
Self.onerror = null;
CurrentX = CurrentY = 0;
Whichit = null;
LASTSCROLLX = 0; lastscrolly = 0;
NS = (document.layers)? 1:0;
IE = (document.all)? 1:0;
function HeartBeat (objectid) {
if (IE) {diffy = Document.body.scrollTop; diffx = Document.body.scrollLeft;}
if (NS) {diffy = Self.pageyoffset; diffx = Self.pagexoffset;}
if (Diffy!= lastscrolly) {
Percent =. 1 * (diffy-lastscrolly);
If (Percent > 0) percent = Math.ceil (percent);
else percent = Math.floor (percent);
if (IE) {
Objectid = Objectid.split (";");
for (i = 0; i < objectid.length i++) eval ("document.all.") +objectid[i]). Style.pixeltop + = percent;
}
if (NS) {
Objectid = Objectid.split (";");
for (i = 0; i < objectid.length i++) eval ("document.") +objectid[i]). Top + = percent;
}
lastscrolly = lastscrolly + percent;
}
if (diffx!= lastscrollx) {
Percent =. 1 * (DIFFX-LASTSCROLLX);
If (Percent > 0) percent = Math.ceil (percent);
else percent = Math.floor (percent);
if (IE) {
Objectid = Objectid.split (";");
for (i = 0; i < objectid.length i++) eval ("document.all.") +objectid[i]). Style.pixelleft + = percent;
}
if (NS) {
Objectid = Objectid.split (";");
for (i = 0; i < objectid.length i++) eval ("document.") +objectid[i]). Left + = percent;
}
LASTSCROLLX = lastscrollx + percent;
}
}
if (NS | | IE) action = Window.setinterval ("heartBeat (' Floater;floater1 ')", 2); OK, success is so simple! Div inside the text can be replaced by pictures and tables, id do not change on the line ...
In addition, remember the above code in order not to interfere with the display of this article, in the "<>" added a space, copy to the document to remember to modify.
In addition to the above methods, another method of implementation is collected from other websites, as follows:
In the Display page, add:
< SCRIPT language= "JavaScript" src= "js/flr.js" ></script >
< SCRIPT language= "JavaScript" src= "js/fll.js" ></script >--------------------------- Flr.js------------------------------------
var imgheight
Document.ns = Navigator.appname = = "Netscape"
Window.screen.width>800? imgheight=100:imgheight=120
function Myload ()
{
if (navigator.appname = "Netscape")
{document.dangdang.pagey=pageyoffset+window.innerheight-imgheight-0;
document.dangdang.pagex=+window.innerwidth-107;
Mymove ();
}
Else
{
dangdang.style.top=document.body.scrolltop+document.body.offsetheight-imgheight-0;
dangdang.style.left=document.body.offsetwidth-107;
Mymove ();
}
}
function Mymove ()
{
if (DOCUMENT.NS)
{
document.dangdang.top=pageyoffset+window.innerheight-imgheight-0;
document.dangdang.left=pagexoffset+window.innerwidth-107;
SetTimeout ("Mymove ();", 50)
}
Else
{
dangdang.style.top=document.body.scrolltop+document.body.offsetheight-imgheight-0;
dangdang.style.left=document.body.scrollleft+document.body.offsetwidth-107;
SetTimeout ("Mymove ();", 50)
}
}
function Mm_reloadpage (init) {//reloads the window if Nav4 resized
if (init==true) with (navigator) {if (appname== "Netscape") && (parseint (appversion) ==4)) {
Document. Mm_pgw=innerwidth; Document. Mm_pgh=innerheight; Onresize=mm_reloadpage; }}
else if (innerwidth!=document. MM_PGW | | Innerheight!=document. MM_PGH) location.reload ();
}
Mm_reloadpage (True)
if (navigator.appname = "Netscape")
{
document.write ("href=# ' > src=" *. GIF ' width= ' height= ' > ');
Myload ()}
Else
{
document.write ("
");
Myload ()
}-------------------------fll.js--------------------------------------
var imgheight
var imgleft
Document.ns = Navigator.appname = = "Netscape"
Window.screen.width>800? imgheight=110:imgheight=110
Window.screen.width>800? Imgleft=5:imgleft=5
function Myload ()
{
if (navigator.appname = "Netscape")
{document.myleft.pagey=pageyoffset+window.innerheight-imgheight;
Document.myleft.pagex=imgleft;
Leftmove ();
}
Else
{
Myleft.style.top=document.body.scrolltop+document.body.offsetheight-imgheight;
Myleft.style.left=imgleft;
Leftmove ();
}
}
function Leftmove ()
{
if (DOCUMENT.NS)
{
Document.myleft.top=pageyoffset+window.innerheight-imgheight
Documen
T.myleft.left=imgleft;
SetTimeout ("Leftmove ();", 80)
}
Else
{
Myleft.style.top=document.body.scrolltop+document.body.offsetheight-imgheight;
Myleft.style.left=imgleft;
SetTimeout ("Leftmove ();", 80)
}
}
function Mm_reloadpage (init) {//reloads the window if Nav4 resized
if (init==true) with (navigator) {if (appname== "Netscape") && (parseint (appversion) ==4)) {
Document. Mm_pgw=innerwidth; Document. Mm_pgh=innerheight; Onresize=mm_reloadpage; }}
else if (innerwidth!=document. MM_PGW | | Innerheight!=document. MM_PGH) location.reload ();
}
Mm_reloadpage (True)
if (navigator.appname = "Netscape")
{
document.write ("href= ' http://www.polocars.com/' >width= ' height= '" > ");
Myload ()}
Else
{
document.write ("
");
Myload ()
}

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.