1<scripttype="text/javascript">2gaibian();3window.onresize=gaibian;4functiongaibian(){5varkuangdu=document.documentElement.clientWidth;6if(kuangdu>1024){7document.getElementById("links").href="CSS/big_screen.css";8}elseif(kuangdu>600&&kuangdu<=1024){9document.getElementById("links").href="css/mi_screen.css";10}else{11document.getElementById("links").href="css/min_screen.css";12}13}14</script>View Code
window.onload=function(){varoUl1=document.getElementById('ul1');varaLi=oUl1.getElementsByTagName('li');varoMeng=document.getElementById('meng');varoImg=document.getElementById('img1');//vartimer=null;varindex=0;for(vari=0;i<aLi.length;i++){aLi[i].index=i;aLi[i].onclick=function(){setTimeout(function(){oMeng.style.display="block";//第一步的动画开始出来});setTimeout(function(){location.href="index05.html";//动画过后执行的动作},2000);index=this.index;oImg.src="img/tu"+index+".jpg";//改变图片的路径}}}View Code
1<scripttype="text/javascript">2$(function(){3setTimeout(function(){4$(".loading_1").hide();5},8000)//加载动画6})7</script>8<divstyle="display:none;">9<scripttype="text/javascript">varcnzz_protocol=(("https:"==document.location.protocol)?"https://":"http://");document.write(unescape("%3Cspanid='cnzz_stat_icon_1254406391'%3E%3C/span%3E%3Cscriptsrc='"+cnzz_protocol+"s95.cnzz.com/z_stat.php%3Fid%3D1254406391'type='text/javascript'%3E%3C/script%3E"));</script>10</div>11</body>12<?php13//分享内容14$url='http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];15require_once'js/share.php';16?>17<scripttype="text/javascript">18functionpreload(arr){19vari=arr.length,20o,21d=document,22b=document.body,23isIE=/*@cc_on!@*/0;24while(i--){25if(isIE){26newImage().src=arr[i];27continue;28}29o=d.createElement('object');30o.data=arr[i];31o.width=o.height=0;32b.appendChild(o);33}34}3536window.onload=function(){37preload([38'http://new.yangyue.com.cn/wechat/dibiao/activity/tebo/img/shengzhi.png',39'http://new.yangyue.com.cn/wechat/dibiao/activity/tebo/img/shengzhi02.png',40'http://new.yangyue.com.cn/wechat/dibiao/activity/tebo/img/video_pic.png',41'http://new.yangyue.com.cn/wechat/dibiao/activity/tebo/img/p01_ti.png',42'http://new.yangyue.com.cn/wechat/dibiao/activity/tebo/img/p7_txt.png',43'http://new.yangyue.com.cn/wechat/dibiao/activity/tebo/img/p2_bg.jpg',44'http://new.yangyue.com.cn/wechat/dibiao/activity/tebo/img/p1_bg.jpg',45'http://new.yangyue.com.cn/wechat/dibiao/activity/tebo/img/p3_bg.jpg',46'http://new.yangyue.com.cn/wechat/dibiao/activity/tebo/img/p4_bg.jpg',47'http://new.yangyue.com.cn/wechat/dibiao/activity/tebo/img/p05_bg.jpg',48'http://new.yangyue.com.cn/wechat/dibiao/activity/tebo/img/kk.jpg',49]);//预加载图片路径50}51</script>View Code
1<scripttype="text/javascript">2functions(){3$(".phone").addClass("shake");4}5functionss(){6$(".phone").removeClass("shake");7}8setInterval(s,2000)//要晃的湾湾9setTimeout(function(){10setInterval(ss,2000)11},1000)12</script>View Code//alert(document.documentElement.clientWidth);//文档可视区域宽度
}1$(document).ready(function()
2{3alert($(window).height());//浏览器时下窗口可视区域高度4alert($(document).height());//浏览器时下窗口文档的高度5alert($(document.body).height());//浏览器时下窗口文档body的高度6alert($(document.body).outerHeight(true));//浏览器时下窗口文档body的总高度包括borderpaddingmargin7alert($(window).width());//浏览器时下窗口可视区域宽度8alert($(document).width());//浏览器时下窗口文档对于象宽度9alert($(document.body).width());//浏览器时下窗口文档body的高度10alert($(document.body).outerWidth(true));//浏览器时下窗口文档body的总宽度包括borderpaddingmargin11}12)只要加载到所要执行部分的结构就会执行
$(document).ready(function(){})-------------------------------------其中window可以使任何对象
window.onload=function(){//界面加载完了执行的内容}--------------------------------------------------Javascript刷新页面的几种方法:
history.go(0)location.reload()location=locationlocation.assign(location)document.execCommand('Refresh')window.navigate(location)location.replace(location)document.URL=location.href说明一下,jQuery没有发现刷新页面的方法。
window.resize(function(){上面选一个放到这里。});新闻热点
疑难解答