• 网络学院
  • IT资讯
  • 操作系统
  • 网络技术
  • 软件应用
  • 办公软件
  • 编程技术
  • 网站架设
  • 数据库类
  • 平面设计
  • 多媒体类
  • 游戏资讯
  • 教学论文
  • 认证考试
公告效果
  站点:
  • 首 页
  • 最新软件
  • 文章教程
  • 国内软件
  • 国外软件
  • 绿色软件
  • 源码下载
  • 字体下载
公告效果
软件发布 公告效果
网络软件 系统工具 应用软件 联络聊天 图形图像 多媒体类 行业软件 游戏娱乐 编程开发 安全相关 教育教学 数码软件 绿软下载
热门软件: QQ 瑞星 pplive e话通 木马克星 千千静听 office2000 五笔字根 Photoshop 视频分割
返回文章教程首页 >> 文章首页 >> 网站架设 >> HTML/CSS >> 公告效果

公告效果

添加时间: 2005-6-9 4:25:22  作者: 网络收集  阅读次数:54   来源: http://d9soft.com

        <SCRIPT language=JavaScript>
   FDRboxWid = 500;       //脚本显示区宽度
   FDRboxHgt = 60;         //脚本显示区高度
   FDRborWid = 0;
   FDRborCol = "#070707";
   FDRborSty = "solid";
   FDRbackCol = "";
   FDRboxPad = 4;

   FDRtxtAln = "center";
   FDRlinHgt = "6pt";
   FDRfntFam = "Verdana,Arial,Helvetica,sans-serif,宋体";
   FDRfntCol = "";
   FDRfntSiz = "9pt";
   FDRfntWgh = "";
   FDRfntSty = "normal";
   FDRlnkCol = "#000080";
   FDRlnkDec = "underline";
   FDRhovCol = "#2f2f4f";

   FDRgifSrc = "images/fade.gif";
   FDRgifInt = 60;

   FDRblendInt = 6;
   FDRblendDur = 1;
   FDRmaxLoops = 100;

   FDRendWithFirst = true;
   FDRreplayOnClick = true;
  
   FDRjustFlip = false;
   FDRhdlineCount = 0;

NS4 = (document.layers);
IE4 = (document.all);

appVer = navigator.appVersion;
IEmac = (IE4 && appVer.indexOf("Mac") != -1);
IE4mac = (IEmac && appVer.indexOf("MSIE 4") != -1);
IE40mac = (IE4mac && appVer.indexOf("4.0;") != -1);
IE45mac = (IE4mac && appVer.indexOf("4.5;") != -1);
NSpre401 = (NS4 && (parseFloat(appVer) <= 4.01));
NSpre403 = (NS4 && (parseFloat(appVer) <= 4.03));

FDRjustFlip = (window.FDRjustFlip) ? FDRjustFlip : false;
FDRhdlineCount = (window.FDRhdlineCount) ? FDRhdlineCount : 1;

FDRfinite = (FDRmaxLoops > 0);
FDRisOver = false;
FDRloadCount = 0;

blendTimer = null;

if (!window.prefix) prefix = "";
window.onload = FDRcountLoads;

if (NS4) {
        if(FDRjustFlip NSpre403) {
                totalLoads = 1;
                FDRfadeImg = new Object();
                FDRfadeImg.width = FDRboxWid - (FDRborWid*2);;
        }
        else {
                totalLoads = 2;
                FDRfadeImg = new Image();
                FDRfadeImg.onload = FDRcountLoads;
                FDRfadeImg.onerror = FDRcountLoads;
                FDRfadeImg.src = FDRgifSrc;
        }
}

function FDRcountLoads(e) {
        if (IE4) {
                setTimeout("FDRinit()",1);
        }
        else {
                if(e.type == "error") FDRjustFlip = true;
                FDRloadCount++;
                if (FDRloadCount==totalLoads) {
                        origWidth = innerWidth;
                        origHeight = innerHeight;
                        window.onresize = function(){
                                if (innerWidth==origWidth && innerHeight==origHeight) return;
                                location.reload();
                        }
                        FDRinit();
                }
        }
}

function FDRinit(){
        if(!window.arNews) {
                if(!window.arTXT !window.arURL) return;
                if(arTXT.length != arURL.length) return;
                arNews = [];
                for (i=0;i<arTXT.length;i++){
                        arNews[arNews.length] = arTXT[i];
                        arNews[arNews.length] = arURL[i];
                }
        }

    if (NS4) {
        if (!document.elFader) return;
                with(document.classes.newslink.A) {
                        textDecoration = FDRlnkDec;
                        color = FDRlnkCol;
                        fontWeight = FDRfntWgh;
                        fontSize = FDRfntSiz;
                        fontStyle = FDRfntSty;
                        fontFamily = FDRfntFam;
                        lineHeight = FDRlinHgt;
                        textAlign = FDRtxtAln;
                }
                with(document.classes.nolink.P) {
                        color = FDRfntCol;
                        fontWeight = FDRfntWgh;
                        fontSize = FDRfntSiz;
                        fontStyle = FDRfntSty;
                        fontFamily = FDRfntFam;
                        lineHeight = FDRlinHgt;
                        textAlign = FDRtxtAln;
                }
        elFader = document.elFader;
                with (elFader) {
                        document.write(" ");
                        document.close();
                        bgColor = FDRborCol;
                        clip.width = FDRboxWid;
                        clip.height = FDRboxHgt;
                }

                contWidth = FDRboxWid - (FDRborWid*2);
                contHeight = FDRboxHgt - (FDRborWid*2);
                elCont = new Layer(contWidth,elFader);
                with (elCont) {
                        top = FDRborWid;
                        left = FDRborWid;
                        clip.width = contWidth;
                        clip.height = contHeight;
                        bgColor = FDRbackCol;
                        visibility = "inherit";
                }

                newsWidth = contWidth - (FDRboxPad*2);
                newsHeight = contHeight - (FDRboxPad*2);
        elNews = new Layer(newsWidth,elCont);
                with (elNews) {
                        top = FDRboxPad;
                        left = FDRboxPad;
                        clip.width = newsWidth ;
                        clip.height = newsHeight;
                }

                if (!FDRjustFlip) {
                        elGif = new Layer(contWidth,elCont);
                imStr = "<IMG SRC='" + FDRgifSrc +"' WIDTH="+ Math.max(FDRfadeImg.width,(FDRboxWid - (FDRborWid*2)));
                        imStr += (NSpre403) ? " onError='window.FDRjustFlip = true'>" : ">";
                with (elGif) {
                                document.write(imStr);
                        document.close();
                                moveAbove(elNews);
                        }
       
                        imgHeight = elGif.document.height;
                        slideInc = (imgHeight/(FDRblendDur*1000/FDRgifInt));
                        startTop = -(imgHeight - FDRboxHgt);
                }

                elFader.visibility =  "show";
    }
    else {
        if (!window.elFader) return;
                elFader.innerHTML ="";
                if(IE4mac) {
                        document.body.insertAdjacentHTML("BeforeBegin","<STYLE></STYLE>");
                }
                else {
                        if (!document.styleSheets.length) document.createStyleSheet();
                }
                with (document.styleSheets(document.styleSheets.length-1)) {
                        addRule("A.newslink","text-decoration:"+FDRlnkDec+";color:"+ FDRlnkCol);
                        addRule("A.newslink:hover","color:"+ FDRhovCol);
                }

                with (elFader.style) {
                        errorOffset = (IE4mac) ? (FDRboxPad + FDRborWid) : 0;
                        width = FDRboxWid - (errorOffset * 2);
                        height = FDRboxHgt - (errorOffset * 2);
                        if(IE4mac && !IE45mac){
                                pixelLeft = elFader.offsetLeft + errorOffset;
                                pixelTop = elFader.offsetTop + errorOffset;
                        }

                        backgroundColor = FDRbackCol;
                        overflow = "hidden";
                        color = FDRfntCol;
                        fontWeight = FDRfntWgh;
                        fontSize = FDRfntSiz;
                        fontStyle = FDRfntSty;
                        fontFamily = FDRfntFam;
                        lineHeight = FDRlinHgt;
                        textAlign = FDRtxtAln;
                        cursor = "default";
                        visibility = "visible";
                        borderWidth = FDRborWid;
                        borderStyle = FDRborSty;
                        borderColor = FDRborCol;
                        padding  = FDRboxPad;

                        if(!FDRjustFlip) filter = "blendTrans(duration=" + FDRblendDur + ")";
                }
                elFader.onselectstart = function(){return false};

                IEhasFilters = (elFader.filters.blendTrans) ? true : false;

    }

        if (!NSpre401) {
                elFader.onmouseover = function (){
                        FDRisOver = true;
                }
                elFader.onmouseout = function(){
                        FDRisOver = false;
                        status = "";
                }
        }
       
        FDRstart(0);
}

function FDRstart(ind){
    newsCount = ind;
    if (FDRfinite) loopCount = 0;
    FDRdo();
    blendTimer = setInterval("FDRdo()",FDRblendInt*1000)
}

function FDRdo() {
        if(!blendTimer && loopCount>0) return;

    if (FDRfinite && loopCount==FDRmaxLoops) {
        FDRend();
                return;
    }
        FDRfade();

    if (newsCount == arNews.length) {
        newsCount = 0;
        if (FDRfinite) loopCount++;
    }
}

function FDRmakeStr(){
        tempStr = "";
        for (i=0;i<FDRhdlineCount;i++){
                if(newsCount>=arNews.length)break;
                dispStr = arNews[newsCount];
                linkStr = arNews[newsCount+1];
                isLink = linkStr.length;
                if (isLink) {
                        tempStr += "<P><A CLASS=newslink "
                                        + "HREF='" + prefix + linkStr + "'>"
                            + dispStr + "</A></P>"
                }
                else {
                        tempStr += ((NS4) ? "<P CLASS=nolink>" : "<P>") +dispStr+"</P>";

                }
        if(IE40mac) tempStr +="<BR>";
                newsCount += 2;
        }
        return tempStr;
}

function FDRfade(){
        newsStr = FDRmakeStr();

    if (NS4) {
                if (!FDRjustFlip) {
                        elGif.top = startTop;
                        elGif.visibility = "inherit";
                }

                elNews.visibility = "hide";
        with (elNews.document) {
            write(newsStr);
            close();
        }
                elNews.visibility = "inherit";
    }
    else {
        if(IEhasFilters)elFader.filters.blendTrans.Apply();
        elFader.innerHTML = newsStr;
        if(IEhasFilters)elFader.filters.blendTrans.Play();
    }

        if(FDRhdlineCount==1) window.status = (FDRisOver && isLink) ? (prefix + linkStr) : "";

    if (NS4 && !FDRjustFlip) FDRslide();
}

function FDRslide(){
    elGif.top += slideInc;
    if (elGif.top >= 0) {elGif.visibility = "hide";return}
    setTimeout("FDRslide()",FDRgifInt);
}

function FDRdblClickNS(){
        elFader.releaseEvents(Event.DBLCLICK);
        FDRstart(startIndex);
        return false;
}

function FDRend(){
        clearInterval(blendTimer);

        blendTimer = null;

        if (FDRendWithFirst) {
                newsCount = 0;
                FDRfade();
        }
        if (FDRreplayOnClick) {

                startIndex = FDRendWithFirst ? (FDRhdlineCount * 2) : 0;
                if (IE4) {
                        elFader.title = "Double click to replay";
                        elFader.ondblclick = function(){
                                this.ondblclick = null;
                                this.title = "";
                                FDRstart(startIndex);
                        }
                }
                else {
                        elFader.captureEvents(Event.DBLCLICK);

                        elFader.ondblclick = FDRdblClickNS;

                }
    }
}
   </SCRIPT>
   <SCRIPT language=JavaScript type=text/javascript>
    prefix="";
   //项目开始,支持HTML语法(包括IMG)
   arNews = ["<b><font color=red>欢迎光临无忧脚本!</font></b>","","有问题请发贴","","<img src=http://be10.ods.org/51js/images/standard/51js.gif border=0>","","嘿嘿,你瞧,插图片也可以的~",""]
   //项目结束
   </SCRIPT>
   <DIV id=elFader style="VISIBILITY: hidden; POSITION: relative"></DIV>

 

上下文章:

 

上一篇文章: 不错的表格效果,表中表 下一篇文章: CSS的小问题

相关文章:

  • Photoshop教程:教你如何创出发丝的炫彩莹亮效果
  • 模仿景深效果 用PS扫除杂乱背景
  • Photoshop简单的艺术化效果
  • 用Photoshop美发:焗油效果先知道
  • 利用PS通道快速打造梦幻紫色效果

相关软件:

  • XP内存优化工具任务管理器版(效果非常不错)
  • 电子图片公告牌
  • 时尚站内公告系统 Build 0920
  • 乌龙主页更新公告板 v1.0

 

快速导航

  • 网络学院
  • 精品汇聚
  • 字体下载
  • 教程下载
  • ASP源码
  • PHP源码
  • Net源码
  • JSP 源码

网站架设分类导航

  • DreamWeaver
  • HTML/CSS
  • Flash
  • Firework
  • FrontPage
  • 建站指南

本类经典文章推荐

  • 总结:CSS在IE与Firefox下的兼容性
  • 经典:CSS应用常见问题大总结
  • 网站设计的标准时代
  • 用层模拟下拉列表框
  • 苏沈小雨样式表中文手册系列
  • 用CSS控制网页总体风格
  • WEB界面设计五种特征
  • 深入透析样式表滤镜(上)
  • HTML的基本元素
  • 网页中多层效果的灵活使用

HTML/CSS阅读排行

  • 用层模拟下拉列表框
  • 突破网页文字无法复制局限
  • 流程图软件Visio作“高难度”网页
  • 苏沈小雨样式表中文手册系列
  • WEB界面设计五种特征
  • 用CSS控制网页总体风格
  • 图片模糊转清晰
  • 制作精美圆角表格两种方法
  • 网页制作小工具大全(下)
  • 网页制作小工具大全(中)

网站架设阅读总排行

  • 用层模拟下拉列表框
  • 教你如何用Dreamweaver制作电子相...
  • 用Dreamweaver插件制作动态下拉菜...
  • 突破网页文字无法复制局限
  • 如何设计首页???(解答)
  • Dreamweaver基础技巧-布局阶段
  • 动态QQ表情DIY Fireworks轻松搞定
  • 流程图软件Visio作“高难度”网页
  • 网页制作隐藏对象巧利用
  • 站点-网页布局设计基础

广告位置

字母检索 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 回到顶部

关于我们 | 版权声明 | 免责条款 | 广告联系 | 软件发布 | 下载帮助 | 下载排行 | 网站地图 | 特别鸣谢 | 友情连接

copyright; 2005-2008 D9soft.com 第九软件网 版权所有