<html>
<head>
<style type="text/css">
.picture-wall-container{
position: relative;
margin:100px;
}
.picture{
position: absolute;
padding:5px;
background-color: white;
box-shadow: gray 1px 1px 1px;
transition:transform 0.3s;
}
</style>
<script type="text/javascript" src="jquery.js"></script>
</head>
<body>
<div class="picture-wall-container">
<img id="picture-1" class="picture" src="imgs/1.png" />
<img id="picture-2" class="picture" src="imgs/2.png" />
<img id="picture-3" class="picture" src="imgs/3.png" />
<img id="picture-4" class="picture" src="imgs/4.png" />
<img id="picture-5" class="picture" src="imgs/5.png" /> <img id="picture-6" class="picture" src="imgs/6.png" />
<img id="picture-7" class="picture" src="imgs/7.png" />
<img id="picture-8" class="picture" src="imgs/8.png" />
<img id="picture-9" class="picture" src="imgs/9.png" />
<img id="picture-10" class="picture" src="imgs/10.png" /> <img id="picture-11" class="picture" src="imgs/11.png" />
<img id="picture-12" class="picture" src="imgs/12.png" />
<img id="picture-13" class="picture" src="imgs/13.png" />
<img id="picture-14" class="picture" src="imgs/14.png" />
<img id="picture-15" class="picture" src="imgs/15.png" />
</div>
<script type="text/javascript">
function getRandom(min, max){
var r = Math.random()*(max-min)+min;
r = Math.ceil(r);
return r;
}
$(document).ready(function(){
var hcount = 5;
var vcount = 3;
var picWidth = 300;
var picHeight = 200;
var left = 0;
var top = 0;
var angles = [];
var zindexs = [];
for(var i = 1; i <= 5;i++){
left = left + picWidth - picWidth/3;
if(i == 1){
left = 0;
}
var picid = "#picture-" + i;
var zindex = getRandom(0,10)%3+1;
var angle = getRandom(5, 15);
var d = getRandom(0, 10);
if(d<=5){
angle *= -1;
}
$(picid).css({"left":left+"px","top":top+"px","z-index":zindex,"transform":"rotate("+angle+"deg)"});
}
left = 0;
top = 2*picHeight/3;
for(i=6;i<=10;i++){
left = left + picWidth - picWidth/3;
if(i== 6){
left = 0;
}
picid="#picture-"+i;
zindex = getRandom(0,10)%3+1;
angle = getRandom(5, 15);
d = getRandom(0, 10);
if(d<=5){
angle *= -1;
}
$(picid).css({"left":left+"px","top":top+"px","z-index":zindex,"transform":"rotate("+angle+"deg)"});
}
left = 0;
top = 4*picHeight/3;
for(i=11;i<=15;i++){
left = left + picWidth - picWidth/3;
if(i== 11){
left = 0;
}
picid="#picture-"+i;
zindex = getRandom(0,10)%3+1;
angle = getRandom(5, 15);
d = getRandom(0, 10);
if(d<=5){
angle *= -1;
}
$(picid).css({"left":left+"px","top":top+"px","z-index":zindex,"transform":"rotate("+angle+"deg)"});
}
$(".picture").each(function(index, item){
$(this).hover(function(){
angles[index] = $(this).css("transform");
zindexs[index] = $(this).css("z-index");
$(this).css({"z-index":4,"transform":"rotate(0deg)"});
},function(){
$(this).css({"z-index":zindexs[index],"transform":angles[index]});
});
});
});
</script>
</body>
</html>

jQuery CSS3 照片墙的更多相关文章

  1. css3照片墙+曲线阴影

    css3照片墙+曲线阴影 最近在学习jquery,晚上想复习下以前学过的知识,看到网上有关于css3照片墙的,感觉挺好玩的,就做了做.(以下图片均来自网络) 一.css3照片墙 html部分: < ...

  2. jQuery+CSS3文字跑马灯特效

    jQuery+CSS3文字跑马灯特效是一款将跑马灯背景制作为3D立方体效果,文字在上面移动时,就像是文字投影到墙壁上,在转角出会改变运动方向. 效果展示 http://hovertree.com/te ...

  3. jquery css3问卷答题卡翻页动画效果

    这个选项调查的特效以选项卡的形式,每答完一道题目自动切换到下一条,颇具特色.使用jQuery和CSS3,适合HTML5浏览器. 效果展示 http://hovertree.com/texiao/jqu ...

  4. jQuery css3鼠标悬停图片显示遮罩层动画特效

    jQuery css3鼠标悬停图片显示遮罩层动画特效 效果体验:http://hovertree.com/texiao/jquery/39/ 效果图: 源码下载:http://hovertree.co ...

  5. 使用 jQuery & CSS3 制作美丽的照片画廊

    在本教程中,我们将创建一个很好看的照片画廊效果.我们的想法是,以显示专辑作为一个滑块,而当这张专辑被选中,我们将使用一个美丽的照片堆栈展示专辑的图像.在照片堆栈视图,我们可以通过将最上面的图像移动到所 ...

  6. jQuery+css3 弹幕

    写了个基于jQuery+css3的弹幕功能,此功能面向手机wap,利用改变位移做弹幕功能会使一些性能低的手机浏览器卡,所以用了css3,此功能不支持非webkit内核浏览器 html部分 自己设置样式 ...

  7. Image Wall - jQuery & CSS3 图片墙效果

    今天我们要为您展示如何基于 jQuery 和 CSS3 创建一个整洁的图片墙效果.我们的想法是在页面上洒上一些大小不同的缩略图,并在当我们点击图片时候显示丝带,会显示一些描述,再次点击缩略图时,丝带将 ...

  8. 学习使用 jQuery & CSS3 制作照片堆栈效果

    在这个小实验中,我们使用 jQuery & CSS3 创建了一个交互式的照片堆栈效果.提供了一些模拟现实的互动的可能性给用户.这个想法的思路是:有一些照片在桌面上可以拖放一样,堆放和删除,每个 ...

  9. 使用 jQuery & CSS3 实现翻转的作品集滑块

    作为 Web 开发人员,我想你一定见过各种各样的图片滑块效果.展示产品或者个人作品的方法有很多,其中之一是使用网格样式的滑块效果.在本教程中,我将分享如何使用 jQuery 和 CSS3 变换实现翻转 ...

随机推荐

  1. Subway POJ 2502

    题目链接: http://poj.org/problem?id=2502 题目大意: 你刚从一个安静的小镇搬到一个吵闹的大城市,所以你不能再骑自行车去上学了,只能乘坐地铁或者步行去上学.因为你不想迟到 ...

  2. 果酷:80后IT男“鲜果切”年入千万 _ 财经频道 _ 东方财富网(Eastmoney.com)

    果酷:80后IT男"鲜果切"年入千万 _ 财经频道 _ 东方财富网(Eastmoney.com) 果酷:80后IT男"鲜果切"年入千万

  3. GitHub 使用手册 - 基础篇

    缘起 Git已经成为程序员必备技能之一,而GitHub做为做流行的Git仓库托管平台,其不仅提供Git仓库托管,还是一个非常棒的技术人员社交平台,可以通过开源的项目进行协作.交流,是现在优秀的工程师必 ...

  4. 一般处理程序中使用Session出现未将对象引用设置到对象的实例

    遇到问题:未将对象引用设置到对象的实例 那就在你的一般处理程序中加入红色背景的代码吧 using System; using System.Collections.Generic; using Sys ...

  5. wxPython学习笔记(二)

    如何创建和使用一个应用程序对象? 任何wxPython应用程序都需要一个应用程序对象.这个应用程序对象必须是类wx.App或其定制的子类的一个实例.应用程序对象的主要目的是管理幕后的主事件循环. 父类 ...

  6. Meth | ubuntu下安装与卸载软件方法

    1.通过deb包安装的情况: 安装.deb包: 代码:sudo dpkg -i package_file.deb反安装.deb包:代码:sudo dpkg -r package_name 2.通过ap ...

  7. Linux LVM 扩展磁盘分区

    系统:centos 6.3--新建分区 fdisk -l /dev/sdc       # 查看分区 fdisk /dev/sdc          # 创建分区 :n                 ...

  8. JAVA通过url获取页面内容

    String address = "http://sports.sina.com.cn/nba/live.html?id=2015050405"; URL url = new UR ...

  9. 关于slideup和slidedown 鼠标多次滑过累积的动画效果

    stop() 方法停止当前正在运行的动画 包括animation动画和slideup/slidedown动画 例如:鼠标经过一个元素时,执行一个slide动画,多次快速经过,不处理的话这个元素会保留累 ...

  10. js接收复选框的值

    <td><input type="checkbox" class="title" name="title" value=& ...