xxtianxiaxing 发表于 2013-2-7 19:28:07

ff和ie通用div置右上角落

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><script>window.onscroll=function(){var aa = document.getElementById("divWatermark");aa.style.top = document.documentElement.scrollTop+"px"; } </script></head> <body><p>AAAAAAAAAAAAAAAAAAAAAAAAAA</p><div id="divWatermark" style="position:absolute;top:0px;right:0px;width:150px;height:30px;background:#093;">Waterrark</div>       <p>AAABBB</p><p>AAABBB</p>   <p>AAABBB</p><p>AAABBB</p>    <p>AAABBB</p><p>AAABBB</p>    <p>AAABBB</p><p>AAABBB</p>    <p>AAABBB</p><p>AAABBB</p>    <p>AAABBB</p><p>AAABBB</p>      </body></html>//判断中文字符串长度方法str.getBytes()得到的就是长度String.prototype.getBytes = function() {      var cArr = this.match(/[^\x00-\xff]/ig);      return this.length + (cArr == null ? 0 : cArr.length);    }
页: [1]
查看完整版本: ff和ie通用div置右上角落