对联广告代码

      杂记 2008-4-15 12:14:00

对联广告代码有很多,

但多要求后台调用别的文件,

有的不需要,

不过同时命令两个id的却少见黑线 

而且希望加各自独立的关闭程序,

特别是要适用5d,

同时要能随滚动条动起来。

对于不懂代码编辑的我,实在有点“鸭子上架”的味道哭

好在本性决定:既然想,就要做。

难受了好几天,

终于杂合改造了一个愤怒汗晕

以表格形式出现,

对日后进一步的折腾,

那是想当的相当的方便啊~~~骄傲的笑

-----------------

效果见两侧“广而告之”,不知是否简练,欢迎多提意见。

将代码加入“标签模板”即可~

-----------------

<!--*****雷公*****代码开始*****http://glxcb.5dblog.com*****--><style type="text/css">
div#floatTips{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-weight:bold;
position:absolute;
top:50px;
left:1px;/*这是默认居右px*/
width:100%;
}</style>
<div id="floatTips"><!--网页两侧悬挂的广告条 左侧  begin-->
<div id="FloatTips1" style="Z-INDEX: 1; LEFT: 15px; WIDTH: 72px; POSITION: absolute; TOP: 50px">
<table id="table91" style="WIDTH: 104px; HEIGHT: 289px" height="289" cellspacing="0" cellpadding="0" width="104" border="1">
    <tbody>
        <tr>
            <td>
            <p align="center"><font color="#ff0000">广而告之</font></p>
            </td>
        </tr>
        <tr>
            <td>
            <table id="table93" height="234" cellspacing="0" cellpadding="0" width="104" align="center" background="http://art.5d.cn/SArts/2008-04/503819711650.jpg" border="0">
                <tbody>
                    <tr>
                        <td height="100%">
                        <p align="center"></p>
                        </td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
        <tr>
            <td>
            <table id="table92" height="100%" cellspacing="0" cellpadding="0" width="100%" align="center" bgcolor="#91916f" border="0">
                <tbody>
                    <tr>
                        <td height="100%">
                        <p align="center"><span><font onmouseover="javascript:this.style.color='#FF0000';this.style.cursor='hand';" style="CURSOR: hand; COLOR: black" onclick="javascritp:closeTips1();" onmouseout="javascript:this.style.color='black'" face="Verdana">关 闭</font></span><strong></strong> </p>
                        </td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
    </tbody>
</table>
</div>
<!--网页两侧悬挂的广告条 左侧  end--><!--网页两侧悬挂的广告条 右侧  begin-->
<div id="FloatTips2" style="Z-INDEX: 1; RIGHT: 15px; WIDTH: 72px; POSITION: absolute; TOP: 50px">
<table id="table91" style="WIDTH: 104px; HEIGHT: 289px" height="289" cellspacing="0" cellpadding="0" width="104" border="1">
    <tbody>
        <tr>
            <td>
            <p align="center"><font color="#ff0000">广而告之</font></p>
            </td>
        </tr>
        <tr>
            <td>
            <table id="table93" height="234" cellspacing="0" cellpadding="0" width="104" align="center" background="http://art.5d.cn/SArts/2008-04/503819711651.jpg" border="0">
                <tbody>
                    <tr>
                        <td height="100%">
                        <p align="center"></p>
                        </td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
        <tr>
            <td>
            <table id="table92" height="100%" cellspacing="0" cellpadding="0" width="100%" align="center" bgcolor="#91916f" border="0">
                <tbody>
                    <tr>
                        <td height="100%">
                        <p align="center"><span><font onmouseover="javascript:this.style.color='#FF0000';this.style.cursor='hand';" style="CURSOR: hand; COLOR: black" onclick="javascritp:closeTips2();" onmouseout="javascript:this.style.color='black'" face="Verdana">关 闭</font></span>&nbsp; </p>
                        </td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
    </tbody>
</table>
</div>
<SCRIPT language=javascript>
    function closeTips1()
    {
     document.all('floatTips1').style.display="none";
    }
    function closeTips2()
    {
     document.all('floatTips2').style.display="none";
    }
</SCRIPT></div>
<script type="text/javascript">
//<![CDATA[
var tips; var theTop = 20/*这是默认高度,越大越往下*/; var old = theTop;
function initFloatTips() {
tips = document.getElementById('floatTips');
moveTips();
};
function moveTips() {
var tt=50;
if (window.innerHeight) {
    pos = window.pageYOffset
}
else if (document.documentElement && document.documentElement.scrollTop) {
    pos = document.documentElement.scrollTop
}
else if (document.body) {
    pos = document.body.scrollTop;
}
pos=pos-tips.offsetTop+theTop;
pos=tips.offsetTop+pos/10;
if (pos < theTop) pos = theTop;
if (pos != old) {
    tips.style.top = pos+"px";
    tt=10;
}
old = pos;
setTimeout(moveTips,tt);
}
initFloatTips();
//!]]>
</script><!--**********代码结束***************-->

------------------------------

上一篇:激情歌伴舞,抒怀意犹长          下一篇:行动要有力,破坏莫嚣张


标签集:TAGS:对联 广告 随动 代码
回复Comments() 点击Count()
喜欢就顶一下

回复Comments

{commentauthor}
{commentauthor}
{commenttime}
{commentnum}
{commentcontent}
作者:
{commentrecontent}