`
xxtianxiaxing
  • 浏览: 661941 次
  • 性别: Icon_minigender_1
  • 来自: 陕西
社区版块
存档分类
最新评论

ff和ie通用div置右上角落

    博客分类:
  • web
阅读更多
 <!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);    
	}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics