当前位置:学会吧培训频道电脑知识学习网页制作Javascript教程JavaScript 浮动广告类» 正文

JavaScript 浮动广告类

[08-08 00:43:18]   来源:http://www.xuehuiba.com  Javascript教程   阅读:8909
概要: var _deleteUnit = function(text){ return Math.round(("" + text).replace(/(px)$/g,""));}; // var _me = this; /*public members*/ this.Version = "1.0"; this.Html = ""; this.Width = 0; this.Height = 0; this.LeftTop = {}; //type of ADInfo this.RightTop = {}; //type of ADInfo this.LeftMiddle = {}; //type of ADInfo t
JavaScript 浮动广告类,标签:javascript视频教程,javascript教程下载,http://www.xuehuiba.com
        var _deleteUnit = function(text){ return Math.round(("" + text).replace(/(px)$/g,""));};
        //
        var _me = this;
       
        /*public members*/
       
        this.Version = "1.0";
        this.Html = "";
        this.Width = 0;
        this.Height = 0;
       
        this.LeftTop = {}; //type of ADInfo
        this.RightTop = {}; //type of ADInfo
        this.LeftMiddle = {}; //type of ADInfo
        this.RightMiddle = {}; //type of ADInfo
        this.LeftBottom = {}; //type of ADInfo
        this.RightBottom = {}; //type of ADInfo

        this.Start = function(){
            if(this.LeftTop instanceof KM.ADInfo && !this.LeftTop.Element)
                this.LeftTop.Element = _initialize(this.LeftTop.Html,this.LeftTop.Width,this.LeftTop.Height);
            if(this.RightTop instanceof KM.ADInfo && !this.RightTop.Element)
                this.RightTop.Element = _initialize(this.RightTop.Html,this.RightTop.Width,this.RightTop.Height);
            if(this.LeftMiddle instanceof KM.ADInfo && !this.LeftMiddle.Element)
                this.LeftMiddle.Element = _initialize(this.LeftMiddle.Html,this.LeftMiddle.Width,this.LeftMiddle.Height);
            if(this.RightMiddle instanceof KM.ADInfo && !this.RightMiddle.Element)
                this.RightMiddle.Element = _initialize(this.RightMiddle.Html,this.RightMiddle.Width,this.RightMiddle.Height);
            if(this.LeftBottom instanceof KM.ADInfo && !this.LeftBottom.Element)
                this.LeftBottom.Element = _initialize(this.LeftBottom.Html,this.LeftBottom.Width,this.LeftBottom.Height);
            if(this.RightBottom instanceof KM.ADInfo && !this.RightBottom.Element)
                this.RightBottom.Element = _initialize(this.RightBottom.Html,this.RightBottom.Width,this.RightBottom.Height);
               
            var clientWidth = document.documentElement.clientWidth;
            var clientHeight = document.documentElement.clientHeight;
            var scrollTop = document.documentElement.scrollTop;
            var scrollLeft = document.documentElement.scrollLeft;
           
            if(this.LeftTop.Element){
                this.LeftTop.Element.style.top = _deleteUnit(scrollTop) + "px";
                this.LeftTop.Element.style.left = _deleteUnit(scrollLeft) + "px";
            }
            if(this.RightTop.Element){
                this.RightTop.Element.style.top = _deleteUnit(scrollTop) + "px";

上一页  [1] [2] [3]  下一页


Tag:Javascript教程javascript视频教程,javascript教程下载电脑知识学习 - 网页制作 - Javascript教程
Copyright 学会吧 All Right Reserved.
在线学习社区!--学会吧
1 2 3 4 5 6 7 7 8 9 10 11 12 13