在ASP。NET中怎样做浮动的层啊
就像www.pconline.com.cn中两边的浮动层一样
会随着窗口慢慢移动可不可以给个源码

解决方案 »

  1.   

    pontus(pontus) 
    经典办法! 
      

  2.   

    pontus(pontus) 
    经典办法! 到低是什么办法啊
    我菜得要命
      

  3.   

    在你要显示的文件中,添加入下面的代码:<!--左右浮标,请勿调整发布顺序-->
    <script LANGUAGE='JavaScript'>
    var ad_float_left_src = "图片1";
    var ad_float_left_url = "链接1";
    var ad_float_left_type = "";
    </script>
    <script src=floatleft_close.js></script>
    <script LANGUAGE='JavaScript'>
    var ad_float_right_src = "图片2";
    var ad_float_right_url = "链接2";
    var ad_float_right_type = "";
    </script><script src=floatright_close.js></script>---------------------------------floatleft_close.js------------------------------------
    document.ns = navigator.appName == "Microsoft Internet Explorer"var imgheight_close
    var imgleft
    window.screen.width>800 ? imgheight_close=120:imgheight_close=120
    window.screen.width>800 ? imgleft=15:imgleft=122
    function myload()
    {
    myleft.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight_close;
    myleft.style.left=imgleft;
    leftmove();
    }
    function leftmove()
     { 
     myleft.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight_close;
     myleft.style.left=imgleft;
     setTimeout("leftmove();",50)
     }function MM_reloadPage(init) {  //reloads the window if Nav4 resized
      if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
        document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
      else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true)function close_float_left(){
    myleft.style.visibility='hidden';
    }if(document.ns){
    document.write("<div id=myleft style='position: absolute;width:80;top:300;left:5;visibility: visible;z-index: 1'>\
    <style>\
    A.closefloat:link,A.refloat:visited {text-decoration:none;color:#000000;font-size:12px}\
    A.closefloat:active,A.refloat:hover {text-decoration:underline;color:#0000FF;font-size:12px}\
    </style>\
    <table border=0 cellpadding=0 cellspacing=0><tr><td>");if(ad_float_left_type!="swf")
    document.write("<a href='" + ad_float_left_url + "' target = '_blank'><img src='" + ad_float_left_src + "' WIDTH=80 HEIGHT=63  border = 0></a>");
    else
    document.write("<EMBED src='" + ad_float_left_src + "' FlashVars='" + ad_float_left_url + "' quality=high  WIDTH=80 HEIGHT=80 TYPE='application/x-shockwave-flash' id=changhongout ></EMBED>");
    document.write("</td></tr><tr><td width=80 height=20 align=right><a href='javascript:close_float_left();void(0);' class=closefloat><b><font color=#dd0000>关闭<font></b></a></td></tr>\
    </table>\
    </div>");myload()
    }--------------------------------------floatright_close.js-----------------------------------------
    var imgheight_close
    document.ns = navigator.appName == "Microsoft Internet Explorer"window.screen.width>800 ? imgheight_close=120:imgheight_close=120
     function myload()
    {
    myright.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight_close;
    myright.style.left=document.body.offsetWidth-120;
    mymove();
    }
     function mymove()
     {
     myright.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight_close;
     myright.style.left=document.body.scrollLeft+document.body.offsetWidth-120;
     setTimeout("mymove();",50)
     }function MM_reloadPage(init) {  //reloads the window if Nav4 resized
      if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
        document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
      else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true)function close_float_right(){
    myright.style.visibility='hidden';
    }if(document.ns){
    document.write("<div id=myright style='position: absolute;width:80;top:0;left:578;visibility: visible;z-index: 1'>\
    <style>\
    A.closefloat:link,A.refloat:visited {text-decoration:none;color:#000000;font-size:12px}\
    A.closefloat:active,A.refloat:hover {text-decoration:underline;color:#0000FF;font-size:12px}\
    </style>\
    <table border=0 cellpadding=0 cellspacing=0><tr><td>");if(ad_float_right_type!="swf")
    document.write("<a href='" + ad_float_right_url + "' target = '_blank'><img src='" + ad_float_right_src + "' WIDTH=80 HEIGHT=80  border = 0></a>");
    else
    document.write("<EMBED src='" + ad_float_right_src + "' FlashVars='" + ad_float_right_url + "' quality=high WIDTH=80 HEIGHT=80 TYPE='application/x-shockwave-flash' wmode=opaque></EMBED>");document.write("</td></tr><tr><td width=80 height=20 align=right><a href='javascript:close_float_right();void(0);'><b><font color=#dd0000>&sup1;&Oslash;±&Otilde;</font></b></a></td></tr>\
    </table>\
    </div>");myload()
    }