研 的个人资料仰望照片日志列表更多 ![]() | 帮助 |
|
仰望11月21日 乔治穆勒确定神旨意的方法
11月18日 JS弹出窗口特效代码(先收好,以后有时间慢慢看)1.弹启一个全屏窗口 <html> 2.弹启一个被F11化后的窗口 <html> 3.弹启一个带有收藏链接工具栏的窗口 <html> 4.网页对话框 <html> yes;help:yes;resizable:yes;status:yes') <html> help:yes;resizable:yes;status:yes')
5.HTA窗口 HTA的全名为HTML Application,翻译过来就是HTML应用程序,你只要简单的用.hta为扩展名保存HTML页面就算创建了一个HTA文件,下面我们就用HTA来编个窗口,将以下这段代码保存为.hta文件,然后再用浏览器打开。 <HTML> 有人会发现上面这些代码与平时的html有点不同,多了HTA:APPLICATION标签,这就是关键之处,hta通过它来提供一系列面向应用程序的功能,接下来再讲一讲它的属性(我的头又在发胀) APPLICATIONNAME属性(applicationName)
这是AS的学习。网址是:http://www.webjx.com/flash/actionscript-8015_4.html if…else语句:这句是如果怎样就执行if后面的语句,如果不是这样就执行else后面的语句. http://www.jscode.cn/jave_img/350808742.htm这是弹出窗口的代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN"> <head>
<!-- meta data --> <meta http-equiv="Content-Language" content="zh-cn" /> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <meta name="robots" content="all" /> <meta name="author" content="在远方@www.jscode.cn" /> <meta name="Copyright" content="Copyright (c) jscode.cn" /> <link rel="icon" href="/favicon.ico" type="image/x-icon" media="screen" /> <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" media="screen" /> <meta name="description" content="网页特效观止" /> <meta name="keywords" content="网页特效,网页特效代码" /> <!-- site title --> <title>点击弹出窗口层,并且背景变暗渐变---网页特效观止|www.jscode.cn|网页特效代码</title> <style> body {font-size:12px;background:#9EC7E7} img {border:0px} #msgDiv { z-index:10001; width:500px; height:400px; background:white; border:#336699 1px solid; position:absolute; left:50%; top:20%; font-size:12px; margin-left:-225px; display: none; } #bgDiv { display: none; position: absolute; top: 0px; left: 0px; right:0px; } </style> <script type="text/javascript"> function showDetail() { //背景 var bgObj=document.getElementById("bgDiv"); bgObj.style.width = document.body.offsetWidth + "px"; bgObj.style.height = screen.height + "px"; //定义窗口
var msgObj=document.getElementById("msgDiv"); msgObj.style.marginTop = -75 + document.documentElement.scrollTop + "px"; //关闭
document.getElementById("msgShut").onclick = function(){ bgObj.style.display = msgObj.style.display = "none"; } msgObj.style.display = bgObj.style.display = "block"; msgDetail.innerHTML="<p align=center>小窗口里的内容</p><p align=center><A href=http://www.jscode.cn><FONT color=#0000ff>网页特效观止</FONT></A></p>" } </script> </head> <body>
<div id="msgDiv">
<div id="msgShut"> 关闭</div> <div id="msgDetail"> </div> </div> <div id="bgDiv"> </div> <p> </p> <p><a href="#" onClick="showDetail()">点击我试试看</a></p> <p> </p> <p> </p> <p> </p> <p> </p> <p>更多网页特效代码尽在 <a href="#">网页特效观止</a></p> </body>
</html>
这是弹出窗口的代码2比上一个长,我还是感觉上一个好用,好看好懂
<html>
<head> <meta name="verify-v1" content="P4T6fFCiPVxqMWZ2eztyXVzMHlnwD0wLQOq6LBHN5Y8=" /> <title> 点击弹出窗口</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <meta http-equiv="Content-Language" content="gb2312" /> <meta name="KeyWords" content="" /> <meta name="description" content="点击弹出窗口" /> <style type="text/css"> *{ margin:0;padding:0; } </style> </head> <body> <div class="cecmbody" id="cecmpolicy">
<div class="leftClass"> <p> 点击后弹出窗口<br> 本页变暗而且不能进行操作!<br></p> <input type="button" value="点击这里" onclick="sAlert('测试效果');" />
</div> <div class="rightClass"> </div> </div> <script type="text/javascript" language="javascript"> //Author:Daviv //Blog:<a href="#" target="_blank" rel="external">#</a> function sAlert(str){
var msgw,msgh,bordercolor; msgw=400;//提示窗口的宽度 msgh=100;//提示窗口的高度 titleheight=25 //提示窗口标题高度 bordercolor="#336699";//提示窗口的边框颜色 titlecolor="#99CCFF";//提示窗口的标题颜色 var sWidth,sHeight; sWidth=document.body.offsetWidth; sHeight=screen.height; var bgObj=document.createElement("div"); bgObj.setAttribute('id','bgDiv'); bgObj.style.position="absolute"; bgObj.style.top="0"; bgObj.style.background="#777"; bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75"; bgObj.style.opacity="0.6"; bgObj.style.left="0"; bgObj.style.width=sWidth + "px"; bgObj.style.height=sHeight + "px"; bgObj.style.zIndex = "10000"; document.body.appendChild(bgObj); var msgObj=document.createElement("div") msgObj.setAttribute("id","msgDiv"); msgObj.setAttribute("align","center"); msgObj.style.background="white"; msgObj.style.border="1px solid " + bordercolor; msgObj.style.position = "absolute"; msgObj.style.left = "50%"; msgObj.style.top = "50%"; msgObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif"; msgObj.style.marginLeft = "-225px" ; msgObj.style.marginTop = -75+document.documentElement.scrollTop+"px"; msgObj.style.width = msgw + "px"; msgObj.style.height =msgh + "px"; msgObj.style.textAlign = "center"; msgObj.style.lineHeight ="25px"; msgObj.style.zIndex = "10001"; var title=document.createElement("h4"); title.setAttribute("id","msgTitle"); title.setAttribute("align","right"); title.style.margin="0"; title.style.padding="3px"; title.style.background=bordercolor; title.style.filter="progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100);"; title.style.opacity="0.75"; title.style.border="1px solid " + bordercolor; title.style.height="18px"; title.style.font="12px Verdana, Geneva, Arial, Helvetica, sans-serif"; title.style.color="white"; title.style.cursor="pointer"; title.innerHTML="关闭"; title.onclick=function(){ document.body.removeChild(bgObj); document.getElementById("msgDiv").removeChild(title); document.body.removeChild(msgObj); } document.body.appendChild(msgObj); document.getElementById("msgDiv").appendChild(title); var txt=document.createElement("p"); txt.style.margin="1em 0" txt.setAttribute("id","msgTxt"); txt.innerHTML=str; document.getElementById("msgDiv").appendChild(txt); } </script> </body> </html> 很精彩的图片特效,许多网站有,开始还以为是FLASH呢,原来是JS的。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>超酷超绚精美图片展示效果代码(三) - 网页特效观止-网页特效代码|JsCode.CN|</title> <style type="text/css"> html { overflow: hidden; } body {
margin: 0px; padding: 0px; background: #000; position: absolute; width: 100%; height: 100%; cursor: crosshair; } #diapoContainer {
position: absolute; left: 10%; top: 10%; width: 80%; height: 80%; background: #222; overflow: hidden; } .imgDC {
position: absolute; cursor: pointer; border: #000 solid 2px; filter: alpha(opacity=90); opacity: 0.9; visibility: hidden; } .spaDC {
position: absolute; filter: alpha(opacity=20); opacity: 0.2; background: #000; visibility: hidden; } .imgsrc {
position: absolute; width: 120px; height: 67px; visibility: hidden; margin: 4%; } #bkgcaption {
position: absolute; bottom: 0px; left: 0px; width: 100%; height: 6%; background:#1a1a1a; } #caption { position: absolute; font-family: arial, helvetica, verdana, sans-serif; white-space: nowrap; color: #fff; bottom: 0px; width: 100%; left: -10000px; text-align: center; } </style>
<script type="text/javascript"> var xm; var ym; /* ==== onmousemove event ==== */
document.onmousemove = function(e){ if(window.event) e=window.event; xm = (e.x || e.clientX); ym = (e.y || e.clientY); } /* ==== window resize ==== */
function resize() { if(diapo)diapo.resize(); } onresize = resize; /* ==== opacity ==== */
setOpacity = function(o, alpha){ if(o.filters)o.filters.alpha.opacity = alpha * 100; else o.style.opacity = alpha; } //////////////////////////////////////////////////////////////////////////////////////////// /* ===== encapsulate script ==== */ diapo = { O : [], DC : 0, img : 0, txt : 0, N : 0, xm : 0, ym : 0, nx : 0, ny : 0, nw : 0, nh : 0, rs : 0, rsB : 0, zo : 0, tx_pos : 0, tx_var : 0, tx_target : 0, /////// script parameters ////////
attraction : 2, acceleration : .9, dampening : .1, zoomOver : 2, zoomClick : 6, transparency : .8, font_size: 18, ////////////////////////////////// /* ==== diapo resize ==== */
resize : function(){ with(this){ nx = DC.offsetLeft; ny = DC.offsetTop; nw = DC.offsetWidth; nh = DC.offsetHeight; txt.style.fontSize = Math.round(nh / font_size) + "px"; if(Math.abs(rs-rsB)<100) for(var i=0; i<N; i++) O[i].resize(); rsB = rs; } }, /* ==== create diapo ==== */
CDiapo : function(o){ /* ==== init variables ==== */ this.o = o; this.x_pos = this.y_pos = 0; this.x_origin = this.y_origin = 0; this.x_var = this.y_var = 0; this.x_target = this.y_target = 0; this.w_pos = this.h_pos = 0; this.w_origin = this.h_origin = 0; this.w_var = this.h_var = 0; this.w_target = this.h_target = 0; this.over = false; this.click = false; /* ==== create shadow ==== */
this.spa = document.createElement("span"); this.spa.className = "spaDC"; diapo.DC.appendChild(this.spa); /* ==== create thumbnail image ==== */
this.img = document.createElement("img"); this.img.className = "imgDC"; this.img.src = o.src; this.img.O = this; diapo.DC.appendChild(this.img); setOpacity(this.img, diapo.transparency); /* ==== mouse events ==== */
this.img.onselectstart = new Function("return false;"); this.img.ondrag = new Function("return false;"); this.img.onmouseover = function(){ diapo.tx_target=0; diapo.txt.innerHTML=this.O.o.alt; this.O.over=true; setOpacity(this,this.O.click?diapo.transparency:1); } this.img.onmouseout = function(){ diapo.tx_target=-diapo.nw; this.O.over=false; setOpacity(this,diapo.transparency); } this.img.onclick = function() { if(!this.O.click){ if(diapo.zo && diapo.zo != this) diapo.zo.onclick(); this.O.click = true; this.O.x_origin = (diapo.nw - (this.O.w_origin * diapo.zoomClick)) / 2; this.O.y_origin = (diapo.nh - (this.O.h_origin * diapo.zoomClick)) / 2; diapo.zo = this; setOpacity(this,diapo.transparency); } else { this.O.click = false; this.O.over = false; this.O.resize(); diapo.zo = 0; } } /* ==== rearrange thumbnails based on "imgsrc" images position ==== */
this.resize = function (){ with (this) { x_origin = o.offsetLeft; y_origin = o.offsetTop; w_origin = o.offsetWidth; h_origin = o.offsetHeight; } } /* ==== animation function ==== */
this.position = function (){ with (this) { /* ==== set target position ==== */ w_target = w_origin; h_target = h_origin; if(over){ /* ==== mouse over ==== */ w_target = w_origin * diapo.zoomOver; h_target = h_origin * diapo.zoomOver; x_target = diapo.xm - w_pos / 2 - (diapo.xm - (x_origin + w_pos / 2)) / (diapo.attraction*(click?10:1)); y_target = diapo.ym - h_pos / 2 - (diapo.ym - (y_origin + h_pos / 2)) / (diapo.attraction*(click?10:1)); } else { /* ==== mouse out ==== */ x_target = x_origin; y_target = y_origin; } if(click){ /* ==== clicked ==== */ w_target = w_origin * diapo.zoomClick; h_target = h_origin * diapo.zoomClick; } /* ==== magic spring equations ==== */
x_pos += x_var = x_var * diapo.acceleration + (x_target - x_pos) * diapo.dampening; y_pos += y_var = y_var * diapo.acceleration + (y_target - y_pos) * diapo.dampening; w_pos += w_var = w_var * (diapo.acceleration * .5) + (w_target - w_pos) * (diapo.dampening * .5); h_pos += h_var = h_var * (diapo.acceleration * .5) + (h_target - h_pos) * (diapo.dampening * .5); diapo.rs += (Math.abs(x_var) + Math.abs(y_var)); /* ==== html animation ==== */
with(img.style){ left = Math.round(x_pos) + "px"; top = Math.round(y_pos) + "px"; width = Math.round(Math.max(0, w_pos)) + "px"; height = Math.round(Math.max(0, h_pos)) + "px"; zIndex = Math.round(w_pos); } with(spa.style){ left = Math.round(x_pos + w_pos * .1) + "px"; top = Math.round(y_pos + h_pos * .1) + "px"; width = Math.round(Math.max(0, w_pos * 1.1)) + "px"; height = Math.round(Math.max(0, h_pos * 1.1)) + "px"; zIndex = Math.round(w_pos); } } } }, /* ==== main loop ==== */
run : function(){ diapo.xm = xm - diapo.nx; diapo.ym = ym - diapo.ny; /* ==== caption anim ==== */ diapo.tx_pos += diapo.tx_var = diapo.tx_var * .9 + (diapo.tx_target - diapo.tx_pos) * .02; diapo.txt.style.left = Math.round(diapo.tx_pos) + "px"; /* ==== images anim ==== */ for(var i in diapo.O) diapo.O[i].position(); /* ==== loop ==== */ setTimeout("diapo.run();", 16); }, /* ==== load images ==== */
images_load : function(){ // ===== loop until all images are loaded ===== var M = 0; for(var i=0; i<diapo.N; i++) { if(diapo.img[i].complete) { diapo.img[i].style.position = "relative"; diapo.O[i].img.style.visibility = "visible"; diapo.O[i].spa.style.visibility = "visible"; M++; } resize(); } if(M<diapo.N) setTimeout("diapo.images_load();", 128); }, /* ==== init script ==== */
init : function() { diapo.DC = document.getElementById("diapoContainer"); diapo.img = diapo.DC.getElementsByTagName("img"); diapo.txt = document.getElementById("caption"); diapo.N = diapo.img.length; for(i=0; i<diapo.N; i++) diapo.O.push(new diapo.CDiapo(diapo.img[i])); diapo.resize(); diapo.tx_pos = -diapo.nw; diapo.tx_target = -diapo.nw; diapo.images_load(); diapo.run(); } } </script>
</head> <body>
<div id="diapoContainer">
<img class="imgsrc" src="images/08081201001.jpg" alt="Reconsider your Existence"> <img class="imgsrc" src="images/08081201004.jpg" alt="Something Needs to be Discovered"> <img class="imgsrc" src="images/08081201005.jpg" alt="They Said Very Little"> <img class="imgsrc" src="images/08081201006.jpg" alt="Only in Your Mind"> <img class="imgsrc" src="images/08081201011.jpg" alt="The Power of Imagination"> <img class="imgsrc" src="images/08081201012.jpg" alt="Objectivity is Impossible"> <img class="imgsrc" src="images/08081201013.jpg" alt="Cleaning Up Operation"> <img class="imgsrc" src="images/08081201014.jpg" alt="Arbitrary Contents"> <div id="bkgcaption"> </div> <div id="caption"> </div> </div> <script type="text/javascript"> /* ==== start script ==== */ function dom_onload() { if(document.getElementById("diapoContainer")) diapo.init(); else setTimeout("dom_onload();", 128); } dom_onload(); </script> </body>
</html> 奥巴马当选演讲全文奥巴马当选演讲全文 如果还有人对美国是否凡事都有可能存疑,还有人怀疑美国奠基者的梦想在我们所处的时代是否依然鲜活,还有人质疑我们的民主制度的力量,那么今晚,这些问题都有了答案。 11月13日 十间房子的故事 (布永康)
|
|
||||||||||||
|
|