Floating Ads Display Script class (Vbs,js dual version)

Source: Internet
Author: User
When writing a project to use the advertising module, in order to not use ASP to generate scripting code is more cumbersome, so the idea of writing script class, that is, a class of script code to control all the same page display of floating ads. But in the process of writing found that the JS script in the settimeout can not use the method of class. Strange, whether I was mistaken or JS script can not do this?? But the VBS script is OK! I faint ...


don't say, paste code:


[VBS script code]


The following code fragment:


'/**************** floating ads display class ****************************************************


'/* Author: Dead Fish in the water


'/* scripting language: VBS


'/* Usage:


'/* Set adver1=new adverclass


'/* adver1.objname= ' Adver1 ' sets the current object name [itself object variable name]


'/* adver1.imgtype=1 ' picture type 0 = normal picture 1=flash animation


'/* adver1.imagewidth=299 ' picture width


'/* adver1.imageheight=87 ' picture height


'/* ### #以下方法显示广告图片 (Flash) object. printhtml "Picture address", "link address", "Hint info"


'/* adver1.printhtml "http://edu.qq.com/flash/moto-button.swf", "http://www.chinese.bj.cn/' target=" _blank " >http://edu.qq.com/flash/moto-button.swf "," http://www.chinese.bj.cn/"," What is this


'/***********************************************************************************


Class Adverclass


Public divID


Public objname


Private Objdiv


public Delay ' Change number


Public Imgtype


Private istep


Private itop,ileft,width,height


Private Topflag,leftflag


' Advertising picture size


Public Imagewidth,imageheight


Private Sub Class_Initialize


Randomize


Divid=int (Rnd (time) *9999+1)


delay=80


Height=document.body.clientheight


Width=document.body.clientwidth


itop=0


ileft=0


Topflag=false:leftflag=false


istep=3


imgtype=0 ' 0 is picture 1 is a flash file


imagewidth=0


imageheight=0


End Sub


Private Sub Class_Terminate


End Sub


public Sub scrollimg ()


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.