<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. 【转】Android中的内存管理--不错不错,避免使用枚举类型

    原文网址:http://android-performance.com/android/2014/02/17/android-manage-memory.html 本文内容翻译自:http://dev ...

  2. [Java] Collections - 源代码学习笔记

    Collection interface 集合接口 1. 在 Collections 体系中,接口 Collection 是根接口 2. 是指一组对象,这些对象被称为 Collection 的元素. ...

  3. poj1190 生日蛋糕 dfs

    题意:生日蛋糕有m层,总体积是V.从下向上,每一层的半径r和高度h都是递减的. 给m.v,求最小的表面积s.(不算底面接地的面积) 题目链接:poj1190 剪枝都还没加..样例输出都是错的...还没 ...

  4. 使用FTPClient进行文件服务器内文件的上传和下载

    我用的FTPClient是由Apache组织的commons-net.jar包中的API,这个包用起来非常的方便,很容易上手.我在项目开发的过程中主要用到了文件的上传和下载功能,下面将我开发的代码贴出 ...

  5. Oracle Quality --- Setup Collection Element and Collection Plan

    Responsibility: Quality, Vision Enterprises 第一步: 创建 Collection Elements setup > collection elemen ...

  6. [Docker] Docker Machine intro

    List all the docker machine: docker-machine ls Can check 'ip' and 'status': docker-machine ip defaul ...

  7. 从sockaddr中取得Ip地址和端口号

    在socket编程中,服务器端accept()等待一个客户端的连接,当连接成功后,accept拷贝客户端的地址信息到sin_addr里面,我们如何从sin_addr取得此客户端的Ip地址和端口号呢? ...

  8. 27个Jupyter Notebook使用技巧及快捷键(翻译版)

    Jupyter Notebook Jupyter Notebook 以前被称为IPython notebook.Jupyter Notebook是一款能集各种分析包括代码.图片.注释.公式及自己画的图 ...

  9. Ajax提交Form表单及文件上传

    刚刚申请下来的博客,写得第一篇.有点小激动,本人以前是一名工业3D设计师突然有些变故做上了JavaWeb开发: 前几天,发现了一些小问题.我在写后台管理页面时,需要上传一张图片.于是我就用很普通的Fo ...

  10. 灵活性比Listview更好的RecycleView

    RecycleView:是Android L版本中新添加的一个用来取代ListView的SDK,它的灵活性与可替代性比listview更好. RecyclerView与ListView原理是类似的:都 ...