1 / 260
文档名称:

HTML代码.doc

格式:doc   大小:939KB   页数:260页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

HTML代码.doc

上传人:drp539606 2019/2/11 文件大小:939 KB

下载得到文件列表

HTML代码.doc

相关文档

文档介绍

文档介绍:JavaScript实现网页拖动层,按住鼠标拖动层,兼容火狐、chrome等浏览器。如演示页面所示,鼠标放在方块上,按住鼠标即可实现拖动,在chrome里有bug的,在onmousedown函数里的最后加入了returnfalse;解决了问题。欢迎帮忙修正问题。<!DOCTYPEhtml><htmlxmlns="9/xhtml"><head><metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/><title>拖动层</title><style>#box{width:100px;height:100px;background:#966;position:absolute;left:100px;top:100px;cursor:pointer;}</style></head><body><divid="box"></div><script>vardoc=document;functiongetViewport(){return{width:(,),height:(,)};}pareNum(x,minNum,maxNum){ switch(true){ casex<minNum:x=minNum;break; casex>maxNum:x=maxNum;break; default:x; } returnx; }='100px'='100px'=function(e){ vare=e||; varmaxL=getViewport().width-100, maxT=getViewport().height-100; =parseInt(); =parseInt(); =; =; =function(e){ posXY(e,0,0,maxL,maxT); }; =function(){ =null; =null; }; returnfalse;}functionposXY(e,minL,minT,maxL,maxT){vare=e||; varx=-(-); vary=-(-); (x,minL,maxL)+'px' (y,minT,maxT)+'px'}</script></body></html>代码最少的网页瀑布流效果CSS实现网页上的瀑布流效果,你会发现它的代码并不多,而且兼容性也相当不错,jQuery的功能当然是大大的。CSS部分的修饰也很重要,示例文字自己改一下,换成图片也可以吧,不过要加入对图片等比例缩放的控制,应该要用到JS吧。如果打开效果有错误,请刷新页面即可。<!DOCTYPEhtml><html><head><metacharset="utf-8"/><title>代码最少的瀑布流实现</title><style>html{_background:url(about:blank);}body{background-color:lightgreen;color:#333;overflow-x:hidden;}body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{margin:0;padding:0;}body,button,input,select,textarea{font:12px/,Tahoma,Helvetica,Arial,simsun}address,cite,dfn,em,var,i{font-style:norm