<script>
function myshow()
{
document.all.mydiv.style.top=document.body.scrollTop;
document.all.mydiv.style.left=document.body.clientWidth-document.all.mydiv.clientWidth;
}
</script>
<body onload=myshow() onscroll=myshow()>
<div id=mydiv style="position:absolute" align=right><img src="show.jpg"><br><span align=right onclick="document.all.mydiv.style.display='none'">关闭</span></div>
文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>
文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>
文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>
文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>文章<p>

解决方案 »

  1.   

    <style type="text/css">
    <!--
    #sponsorAdDiv {position:absolute; height:1; width:1px; top:0; left:0;}
    -->
    </style><script type="text/javascript">
    adTime=10;  // seconds ad reminder is shown
    chanceAd=1; // ad will be shown 1 in X times (put 1 for everytime)var ns=(document.layers);
    var ie=(document.all);
    var w3=(document.getElementById && !ie);
    var calunit=ns? "" : "px"
    adCount=0;
    function initAd(){
    if(!ns && !ie && !w3) return;
    if(ie) adDiv=eval('document.all.sponsorAdDiv.style');
    else if(ns) adDiv=eval('document.layers["sponsorAdDiv"]');
    else if(w3) adDiv=eval('document.getElementById("sponsorAdDiv").style');
    randAd=Math.ceil(Math.random()*chanceAd);
            if (ie||w3)
            adDiv.visibility="visible";
            else
            adDiv.visibility ="show";
    if(randAd==1) showAd();
    }
    function showAd(){
    if(adCount<adTime*10){adCount+=1;
    if (ie){
    documentWidth  =truebody().offsetWidth/2+truebody().scrollLeft-20;
    documentHeight =truebody().offsetHeight/2+truebody().scrollTop-20;
    }
    else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset-20;
    documentHeight=window.innerHeight/2+window.pageYOffset-20;} 
    else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset-20;
    documentHeight=self.innerHeight/2+window.pageYOffset-20;} 
    adDiv.left=documentWidth+calunit;
    adDiv.top =documentHeight-200+calunit;
    setTimeout("showAd()",100);
    }else 
    closeAd();
    }
    function closeAd(){
    if (ie||w3)
    adDiv.display="none";
    else
    adDiv.visibility ="hide";
    }function truebody(){
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
    }onload=initAd;
    //End-->
    </script>
    <div id="sponsorAdDiv" style="visibility:hidden">
    <table width="450px" height="350px" bgcolor="#008000"><tr><td>
    <table width="445px" height="345px" bgcolor="#F0FFF0"><tr><td align="center" valign="middle"><!--*****EDIT THIS MESSAGE*****-->
    <A HREF="http://www.amazon.com/exec/obidos/redirect-home/wa0c?tag-id=wa0c&placement=home-btn-100x70.gif&site=amazon">
    <IMG SRC="2.gif"></A><p><b>Please take time to show your support<br>
    for this site by visiting one<br>
    of our sponsors during this<br> brief intermission.</b>
    </p>
    <p><A HREF="2.gif">
    <IMG SRC="2.gif"></A></p>
    <p>(This announcement will close shortly)
    <br><!--*****EDIT THE ABOVE MESSAGE*****-->
    </td></tr></table></td></tr></table>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br></div>
      

  2.   

    浮动的图片(一动一固定)好
    <body>
    <div style="width:100px;height:1200px;"></div>
    <div id="float" style="width:100px;height:100px;position:absolute;border:solid 1px black;right:0px;top:100px"></div>
    <div id="random-float" style="width:100px;height:100px;position:absolute;border:solid 1px black;left:0px;top:0px"></div> 
    <script type="text/javascript">
    var horizonalUnit=1;
    var verticalUnit=1;
    var interval=5;
    var scrollY=0;document.body.onscroll=function()
    {
    var obj=document.getElementById("float");
    obj.style.top=document.body.scrollTop+100;
    }setTimeout(randFloat,interval);function randFloat()
    {
    var obj=document.getElementById("random-float");
    var offsetY=0;
    if(obj.style.pixelLeft+horizonalUnit+100>document.body.clientWidth||obj.style.pixelLeft+horizonalUnit<0)
    horizonalUnit=0-horizonalUnit;
    if(obj.style.pixelTop+verticalUnit+100>document.body.clientHeight+document.body.scrollTop||obj.style.pixelTop+verticalUnit<document.body.scrollTop)
    verticalUnit=0-verticalUnit;
    if(scrollY!=document.body.srcollTop)
    {
    offsetY=document.body.scrollTop-scrollY;
    scrollY=document.body.scrollTop;
    }obj.style.pixelLeft+=horizonalUnit;
    obj.style.pixelTop+=verticalUnit+offsetY;
    window.status=document.body.clientWidth+","+document.body.clientHeight+":"+(obj.style.pixelTop+verticalUnit+100)+":"+verticalUnit;
    setTimeout(randFloat,interval);
    }
    </script>
    </body>