如果没有设置宽度,无论后面设置的height top left是多少,窗口都会在一个固定的地方打开啊。
2016-07-11
var oTxt = document.getElementById('txt')
//定义"改变颜色"的函数
function color(){
oTxt.style.color ='red';
}
//定义"改变宽高"的函数
function wid(){
oTxt.style.width = "150px";
oTxt.style.height = '150px';
}
//定义"隐藏内容"的函数
function dis(){
oTxt.style.display = 'none';
}
//定义"改变颜色"的函数
function color(){
oTxt.style.color ='red';
}
//定义"改变宽高"的函数
function wid(){
oTxt.style.width = "150px";
oTxt.style.height = '150px';
}
//定义"隐藏内容"的函数
function dis(){
oTxt.style.display = 'none';
}
function openWindow(){
var Read= confirm("Are you ready?");
if(Read){
var openWin = prompt("http://www.imooc.com?");
if(openWin == 666){
window.open('http://www.imooc.com','_blank','width=400,height=500,menubar=no,toolbar=no')
}
}
};
var Read= confirm("Are you ready?");
if(Read){
var openWin = prompt("http://www.imooc.com?");
if(openWin == 666){
window.open('http://www.imooc.com','_blank','width=400,height=500,menubar=no,toolbar=no')
}
}
};
//定义"改变颜色"的函数
function one(){
var txt=document.getElementById("txt");
txt.style.color="red";
txt.style.backgroundColor="blue";
}
function one(){
var txt=document.getElementById("txt");
txt.style.color="red";
txt.style.backgroundColor="blue";
}
//定义"改变宽高"的函数
function two(){
var txt=document.getElementById("txt");
txt.style.width="300px";
txt.style.height="300px";
}
//定义"隐藏内容"的函数
function three(){
var txt=document.getElementById("txt");
txt.style.display="none";
}
function two(){
var txt=document.getElementById("txt");
txt.style.width="300px";
txt.style.height="300px";
}
//定义"隐藏内容"的函数
function three(){
var txt=document.getElementById("txt");
txt.style.display="none";
}
//定义"显示内容"的函数
function four(){
var txt=document.getElementById("txt");
txt.style.display="block";
}
//定义"取消设置"的函数
function deal(){
var a=confirm("是否取消设置");
if(a==true){
var as=document.getElementById("txt");
as.style.cssText="none";
}
else return;
}
function four(){
var txt=document.getElementById("txt");
txt.style.display="block";
}
//定义"取消设置"的函数
function deal(){
var a=confirm("是否取消设置");
if(a==true){
var as=document.getElementById("txt");
as.style.cssText="none";
}
else return;
}