前言:
目前兄弟们对“jqueryscrollfix”可能比较关注,看官们都需要剖析一些“jqueryscrollfix”的相关资讯。那么小编也在网络上网罗了一些关于“jqueryscrollfix””的相关内容,希望各位老铁们能喜欢,各位老铁们快快来了解一下吧!<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>JavaScript:window对象常用方法和事件</title>
<script type="text/javascript">
//方法=============================
window.onload = function () {//匿名方法
this.open_fix_adv();
}
//window对象的方法,因为window对象为全局对象,所以可以省略window
window.setTimeout(function () {
console.dir("5s以后输出");
}, 5000);
window.setInterval(function () {
console.dir("每隔2s输出一次");
}, 2000);
function open_adv() {
window.open("../html/01.html");
}
function open_fix_adv() {
window.open("../html/01.html", "", "height=380,width=320,left=800,top=200,toolbar=0,
scrollbars=0,location=0, status=0,menubar=0,resizable=0");
}
function fullscreen() {
window.open("../html/01.html", "", "fullscreen=1");
}
function close_adv() {
window.close();
}
//确认框
function confirm_msg() {
var flag = window.confirm("are u sure?");
console.dir(flag);
}
//事件=============================
function getonChangeVal() {
var name = document.getElementById("username").value;
var x = document.getElementsByName('username');
console.dir(x[0].value);
console.dir(name);
}
function getonKeyDown() {
var x = document.getElementById("age").value;
console.dir(x);
}
function getonMouseOver() {
console.dir('onmouseover');
}
function printStr() {
console.dir("onload事件");
}
</script>
</head>
<body style="text-align: center;" onload="printStr()">
<input type="button" name="open1" onclick="open_adv()" value="弹出窗口"/>
<br/><br/>
<input type="button" name="open1" onclick="open_fix_adv()" value="弹出固定大小窗口,且无菜单栏等"/>
<br/><br/>
<input type="button" name="open1" onclick="confirm_msg()" value="确认窗口"/>
<br/><br/>
<input type="button" name="open1" onclick="fullscreen()" value="全屏展示"/>
<br/><br/>
<input type="button" name="open1" onclick="close_adv()" value="关闭窗口"/>
<br/><br/>
<input type="text" name="username" id="username" onchange="getonChangeVal()" value="jack"/>
<br/><br/>
<input type="text" name="age" id="age" onkeydown="getonKeyDown()" value="10"/>
<br/><br/>
<p onmousedown="getonMouseOver()">鼠标移到某元素之上</p>
</body>
</html>
标签: #jqueryscrollfix #js window对象方法