html+jQuery实现照片墙
2015-04-13 22:31
176 查看
前提准备,有批量的照片。最好是有共同的前缀,这样有利于jQuery的批处理。
推荐七牛云或者是又拍云,他们可以提供图片的各种处理。直接上代码。
有点类似于瀑布流,用div来布局,划分三个区域。利用JS来动态添加照片
文件也上传到了新浪云,可以戳下列地址看一下:
推荐七牛云或者是又拍云,他们可以提供图片的各种处理。直接上代码。
有点类似于瀑布流,用div来布局,划分三个区域。利用JS来动态添加照片
文件也上传到了新浪云,可以戳下列地址看一下:
照片墙
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <link rel="stylesheet" type="text/css" href="style.css"> <script src="http://cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script> <style type="text/css"> body{ height:700px; background-image:url('http://7sbpxj.com1.z0.glb.clouddn.com/bg.jpg'); } img{ border-radius:5px; margin:5px; position:relative; width:250px; height:auto; border:1px solid darkgray; box-shadow:3px 3px 2px darkgray; } div.divdown{ float:left; position:relative; width:255px; height:50%; margin:5px; } div.divContainer{ padding:20px; width:800px; height:2000px; margin-top:20px; margin-left:auto; margin-right:auto; border:1px solid darkgray; border-radius:10px; box-shadow:3px 3px 2px darkgray; } </style> </head> <body> <div class="divContainer" id="imgbox" > <div class="divdown" id="first"> </div> <div class="divdown" id="second"> </div> <div class="divdown" id="three"> </div> </div> </body> <script> $(function(){ var divdown = new Array("#first","#second","#three"); var qbox = "http://7sbpxj.com1.z0.glb.clouddn.com/mtxx";//七牛云存储 var i=1; var Circle; function out(){ if(i==23){ window.clearInterval(Circle); //已经达到图片上限。关掉定时器 } src = qbox + i + ".jpg";//这里可以添加自己的照片。注意图片要处理等比例宽250的 var newimg = $("<img>").attr('src',src); //创建IMG元素 $(divdown[i%3]).append(newimg); //依次排序过去1,2,3 newimg.fadeTo(50,0); newimg.fadeTo(950,1);//渐入逐出效果 i++; } Circle = setInterval(out,1000); }); </script> </html>
相关文章推荐
- 利用html和Jquery实现照片墙(点击之后放大,再点击缩小)
- 简单的jQuery.jqprint插件实现打印HTML页面,页面导出为PDF文件
- JQuery在HTML中实现图片随鼠标移动而移动
- 实现音乐播放器的代码(html5+css3+jquery)
- jQuery+css+html实现页面遮罩弹出框
- 纯html jquery 实现加载效果(图片旋转)
- 基于jQuery实现照片墙自动播放特效
- 基于jQuery的AJAX和JSON实现纯html数据模板
- jQuery通过点击行来删除HTML表格行的实现示例
- Ipad(IOS 5以前)的safari浏览器下, 如何实现单指滑动Scroll ( html + Jquery 实现)
- 实现音乐播放器的代码(html5+css3+jquery)
- jquery下操作HTML控件的实现代码
- 利用JQuery实现HTML页面跳转
- jQuery+html5+css3实现圆角无刷新表单带输入验证功能代码
- html+css+jquery实现折叠板(模仿搜索风云榜折叠板)
- HTML中动态图片切换JQuery实现
- PSD转HTML实例教程——利用JQuery插件实现图片滑动效果
- jQuery+css+html实现页面遮罩弹出框
- web前端,html+css+jquery实现竖直菜单
- Html+css+js+jquery实现简单页面登录