Saturday, October 10, 2009

How does Dreamweaver make float ad

Roam between the network, you can detect, internet not only the ocean that is information, also be advertising ocean. Besides common Gif Banner, Flash, float advertisement also is one of relatively popular advertisement forms on nowadays net. Pull the roll that uses a browser when you when, this kind of ad that uses in page rise, can follow screen moves together. Although this kind of effect is revealed to advertisement,have the economic value that comparative, but to browsing you the person of the webpage is told, this is hamper already read, affect the thing that reads interest again, accordingly scarcely can be abused. Nevertheless, if you can if be apt to is used, it can produce huge effect.

It is not difficult to should make result of float mood advertising, if you have JS base can oneself write, if write the word that is disinclined to write repeatedly, download tool of a specially good effect to the net, press clew stickup code with respect to OK. Nevertheless, how is wanting to understand it truly done, need to master knowledge of a few JS. Here introduces simple float advertisement way to everybody.

This paragraph of code can be put between <body></body> under, I joined meantime a few annotate (namely " / / " the character after and " < ! , " "- - > " the character between) .
<SCRIPT FOR=window EVENT=onload LANGUAGE="JScript">After InitAd();// is record in a page, call function InitAd()
</SCRIPT>
<script Language="JScript">
< ! - -Function InitAd() {After Document.all.AdLayer.style.posTop = -200;// installs OnLoad incident to arouse, advertisement layer is opposite at securing the Y direction position afterLayer of setting of Document.all.AdLayer.style.visibility = 'visible'// is visible
MoveLayer('AdLayer');// calls function MoveLayer()
}Function MoveLayer(layerName) {Layer of advertisement of float of Var X = 600;// secures the X direction position at the browserLayer of advertisement of float of Var Y = 300;// secures the Y direction position at the browserVar Diff = ( document.body.scrollTop + Y - Document.all.AdLayer.style.posTop)*.40;Var Y = Document.body.scrollTop + Y - Diff;Eval("document.all. Eval("document.all.. + LayerName + ".style.posTop = Y");Eval("document.all. Eval("document.all.. + layer of mobile advertisement of LayerName + ".style.posLeft = X");//SetTimeout("MoveLayer('AdLayer');" , 20);// setting calls function MoveLayer(again after 20 millisecond)
}
/ /- - >
</script>
< ! - - below the layer that is AdLayer for an ID (the name that be like ID is not AdLayer, the AdLayer inside MoveLayer() also wants to be revised accordingly above) , include a piece of picture that takes a link- - >
<div Id=AdLayer Style='position:aBsolute; Width:61px; Height:59px; Z-index:20; Visibility:hIdden;; Left: 600px; Top: 300px'>
<a Href="http://www.5dmedia.com/bbs"><img Src=' . . / Qqkk2000.gif' Border="0" Height="60" Width="60"></a>
</div>

Here, the value that you can set X, Y comes the position that set place secures a layer, change SetTimeout("MoveLayer('AdLayer');" , the of 20 value in 20) hopes to call the time-interval of MoveLayer() for you. Still having those who want an attention is, use picture had better be the Gif graph of transparent setting, obscure in order to make the setting color of the picture unapt from the back content.

Be sure to keep in mind, want careful with float type advertisement, while the consideration uses specially good effect, ten million should consider the sense of the person that browse, cannot be abused!

No comments:

Post a Comment