日期:2014-05-16 浏览次数:20368 次
<!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 type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script type="text/javascript">
var cW,cH;
function scrolls() {
cW = document.documentElement.clientWidth
------解决方案--------------------
document.body.clientWidth;
cH = document.documentElement.clientHeight
------解决方案--------------------
document.body.clientHeight;
var _div = document.createElement('div');
_div.className = 'divClass';
_div.appendChild(document.createTextNode('UP'));
_div.id = 'divId';
_div.onclick = function() {
//document.documentElement.scrollTop = '0';
var bodys = document.documentElement
------解决方案--------------------
document.body;
var explorer = window.navigator.userAgent ;
if(explorer.indexOf("Chrome") >= 0) {
$(document.body).animate({scrollTop: '0'}, 100);
} else {
$(document.documentElement).animate({scrollTop: '0'}, 100);
}
document.getElementById('divId').style.display = 'none';
}
//_div.setAttribute('onclick', function() {