常用javascript特效

1.广告条显示、





  	

3.定时跳转

 	

  	
注册成功 , 当前页面会在 秒之后跳转 . 如果没有跳转 , 则点击这里

4.全选/全否 ,

//默认为 false 没有选中
		var j = 0;
		//全选 / 全否
		function is(){
			//获取所有的 复选对象
			var h = document.getElementsByName("hobby");
			for(i=0;i

5.全选/反选 ,

//全选/反选
		function not(){
			//获取所有的 复选对象
			var h = document.getElementsByName("hobby");
			for(i=0;i

6.播放音频


7.隔行变色  事件绑定。



8.弹出广告

onload = function(){
    		//当前窗体大小

var width = 670; var height = 530; //获取窗体大小 var w = (window.screen.width - width )/2; var h = (window.screen.height - height - 40 )/2; //加载页面就弹出广告窗口 window.open("AD.html","广告","width="+width+"px,height="+height+"px,left="+w+",top="+h+"px"); }

9.滑动广告
	//滚动广告
		onscroll = function(){
			//获取滚动高度
			var t = document.body.scrollTop;
			//赋给当前的层对象
			document.getElementById("div").style.top = t;
		}

		//隐藏广告
    	function hiddnAD(){
			document.getElementById("div").style.visibility = "hidden";
        }






你可能感兴趣的:(javascript)