TBanner in Jscript

xiaoxiao2021-03-06  58

Be a simple banner script to believe a lot of online see, but a lot is not easy to use, and you can't meet the requirements. Just write it when you start, but then I have to put a few Banner, it is not good. I got it. So, just write the entire Class, such a page, several banners have nothing to do. And then call simple, and flexible. No matter which aspect, it is better. Gatener effect: http://impx.net/scripts/tbanner.htm hopes this feature helpful .Example: http://impx.net/scripts/tbanner.htm/*============ ================= Copyright by Dragonimp All Rights Reserved. Description: Class for banners Version1.0 2004.11.24 Email: Dragonimp@impx.net HomePage: http://www.impx.net===============================//usage:

// new banner with string "banner_example" Which should be the same as var. name banner_example // init the base path of images, names, and urls for links // start with interval time

VAR banner_example = new tbanner ("banner_example"); banner_example.init ("/ images / rotate /", New Array ("r1.gif", "r2.gif", "r3.gif"), New Array ("URL1 "" URL2 "," url3 "); banner_example.start (5000); ============================== * /

// preloadfunction preloadImages (images) {var preloadedImages = new array () for (p = 0; p

function Transbanner (the_image, new_image) {// var the_image = this.image; // var images = this.images; the_image.src = new_image; the_image.style.visibility = "hidden"; the_image.filters.item (0) .Apply (); THE_IMAGE.FILTERS.ITEM (0) .Transition = Math.Floor (Math.Random () * 23); THE_IMAGE.FILTERS.ITEM (0) .play (2.0); THE_IMAGE.Style.visibility = " Inherit ";} function tbanner (bannerid) {this.imagePath =" "; this.index = 0; this.Link = null; this.transtime = 6000; this.bannerid = BannerID; THIS. THISTIME = BannerId; THISTIME = 6000; This.Images = new array (); this.urls = new array (); this.init = bannerinit; this.start = bannerStart; THIS.TRANS = BANNERTRANS;}

function BannerInit (imagepath, images, urls) {this.imagepath = imagepath; this.images = images; this.urls = urls; var banner_image = this.bannerid "_ image"; var banner_link = this.bannerid "_ link"; document. Write (" ") PreloadImages (images); this.Image = evAl (banner_image); this.link = evAl (banner_link); bannerTrans (this); // start first trans}

Function bannerTrans (banner) {Transbanne (banner.image, banner.images [banner.index]); if (banner.index = banner.images.length ) Banner.index = 0;

Function bannerStart (THIS.TRANSTIME = TRANSTIME; SETINTERVAL ("Bannertrans (" this.bannerid ")" ", this.transtime)}

转载请注明原文地址:https://www.9cbs.com/read-83752.html

New Post(0)