javascript

var head= document.getElementById("head");            
head.style.cssText="width:200px;height:70px;display:bolck";        //JS设置多个CSS属性

$('a','#container').click(function(){alert('aasdsdf')})            //逗号后面的元素里找逗号前面的元素等同$('#container a')

$(function(){
var aa=document.getElementsByTagName("body")[0];    
var s=document.createElement("div");
s.innerHTML="asdfsdf"
aa.appendChild(s);

}

 

 

window.onload=window.onresize=function(){
var w=window.innerWidth
|| document.documentElement.clientWidth
|| document.body.clientWidth;

var h=window.innerHeight
|| document.documentElement.clientHeight
|| document.body.clientHeight;

var main=document.getElementById("main");
var menu=document.getElementById("menu");

main.style.width = w - 210 + "px";
menu.style.height = h - 95 + "px";
main.style.float = "right";
main.style.height = h - 95 + "px";
}

posted @ 2013-06-20 16:32  菜蛋  阅读(131)  评论(0)    收藏  举报