jQuery和CSS的拍摄效果
<!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=utf-8" />
<title>jQuery和CSS的拍摄效果</title>
<style>
body,h1,h2,h3,p,quote,small,form,input,ul,li,ol,label{margin:0;padding:0}body{color:#fcfcfc;font-size:.825em;background-color:#011d2e;font-family:Arial,Helvetica,sans-serif}#main{margin:0 auto;width:960px;height:600px}.shot{border:3px solid #fcfcfc;float:right;position:relative;margin-left:10px;overflow:hidden;-moz-box-shadow:0 0 2px #000;-webkit-box-shadow:0 0 2px #000;box-shadow:0 0 2px #000}.shot img{display:block}.album{bottom:50px;height:110px;overflow:hidden;position:absolute;right:20px;width:490px}.album .slide{width:700px;height:110px;position:relative;left:-210px}
.container{overflow:hidden;cursor:url(http://www.jq22.com/demo/photo/photoShoot/blank.cur),default;position:relative}.container.googleChrome{cursor:url(http://www.jq22.com/demo/photo/photoShoot/blank_google_chrome.cur),default}.overlay{position:absolute;top:0;left:0;width:100%;height:100%;background:#000}.viewFinder{position:absolute;top:0;left:0}.blur{position:absolute;top:0;left:0}
</style>
</head>
<body> <div id="main"></div> <script src="https://lib.baomitu.com/jquery/1.4.2/jquery.min.js"></script>
<script src="http://www.jq22.com/demo/photo/photoShoot/jquery.photoShoot-1.0.js"></script>
<script>
$(document).ready(function() {
var main = $('#main');
main.width(Math.min(1024, $(document).width()));
var pics = new Array({
url: '/images/index/t.jpg',
size: {
x: 1024,
y: 768
}
},
{
url: '/images/index/t.jpg',
size: {
x: 1024,
y: 768
}
},
{
url: '/images/index/t.jpg',
size: {
x: 1024,
y: 768
}
},
{
url: '/images/index/t.jpg',
size: {
x: 1158,
y: 756
}
});
var bg = pics[parseInt(Math.random() * 4)];
var opts = {
image: bg.url,
onClick: shoot,
opacity: 0.8,
blurLevel: 4
}
main.photoShoot(opts);
$('<div class="album">').html('<div class="slide" />').appendTo(main);
function shoot(position) {
main.find('.overlay').css('background-color', 'white');
setTimeout(function() {
main.find('.overlay').css('background-color', '')
},
100);
var newShot = $('<div class="shot">').width(150).height(100);
newShot.append($('<img src="' + bg.url + '" width="' + (bg.size.x / 2) + '" height="' + (bg.size.y / 2) + '" />').css('margin', -position.top * 0.5 + 'px 0 0 -' + position.left * 0.5 + 'px'));
$('.shot').eq(3).remove();
newShot.css('margin-right', -160).prependTo('.album .slide').animate({
marginRight: 0
},
'slow');
}
});
</script>
</body>
</html>
jQuery和CSS的拍摄效果的更多相关文章
- jQuery属性/CSS使用例子
jQuery属性/CSS 1..attr() 获取匹配的元素集合中的第一个元素的属性的值 或 设置每一个匹配元素的一个或多个属性. 例1:获取元素的属性的值 <p title="段落 ...
- jquery的css详解(二)
jq的工具方法style用于设置样式,jq的实例方法css在设置样式时就是调用的它,接下来分析一下源码. jQuery.extend({ ............................ st ...
- jquery的css详解(一)
通过阅读源码可以发现css是jq的实例方法.而在内部调用jq的工具方法access来实现的,对该方法不了解的朋友请点击 -> jquery工具方法access详解 在access的回调中做了一个 ...
- jquery修改css样式,样式带!important
由于需求的需要,今天在用jquery修改一个弹出框的样式的时候,由于有一个按钮有padding-left:12px;导致内间距空出来的这一块颜色用普通的方式无法改变. 普通的jquery修改css的方 ...
- 使用jquery修改css中带有!important的样式属性
当CSS中含有!important的样式属性时,普通的修改方式是会出现失败的.如下: <div class="test">使用jquery修改css中带有!import ...
- jquery和css自定义video播放控件
下面介绍一下通过jquery和css自定义video播放控件. Html5 Video是现在html5最流行的功能之一,得到了大多数最新版本的浏览器支持.包括IE9,也是如此.不同的浏览器提供了不同的 ...
- 在线运行Javascript,Jquery,HTML,CSS代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xht ...
- JQuery:JQuery操作CSS类
JQuery:CSS类jQuery - 获取并设置 CSS 类,通过 jQuery,可以很容易地对 CSS 元素进行操作.jQuery 操作 CSSjQuery 拥有若干进行 CSS 操作的方法.我们 ...
- jQuery和CSS 3定制HTML 5视频播放器
目前,随着越来越多的浏览器开始支持更多的HTML5新特性,开发者也逐渐关注HTML5的开发.在众多HTML5的新特性中,视频方面的新特性是 很值得开发者和用户关注的.现在,只需要有支持HTML5的浏览 ...
随机推荐
- HDU3478 【判奇环/二分图的性质】
题意: 给你一幅图,给你一个起点,然后问你存不存在一个时刻,所有点可以在那个时刻到达. 思路: 这幅图首先是联通的: 如果出现奇数环,则满足在某一时刻都可能到达: 然后判断奇数环用二分图性质搞也是神奇 ...
- HDU5997 【线段树】
思路: 用vector存一下各种颜色的区间,每次处理颜色的区间,相同颜色不需要更新.区间最多1e6个没错,但是随着颜色的更替区间只会越来越少. 维护区间左右两端的颜色,lazy一下. 区间合并的时候 ...
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined)【A,B,C,D】
呵呵哒,上分~ CodeForces 724A: 题意: 给你两个星期几,问连续两个月的头一天是否满足: #include <iostream> #include <stdio.h& ...
- 51nod 1456【强连通,缩点,并查集】
话说这道题的机遇是看到了http://blog.csdn.net/u010885899/article/details/50611895很有意思:然后就去补了这题 题意: 建最少的边使得给出的点相连. ...
- 分布式集群环境下,如何实现session共享五(spring-session+redis 实现session共享)
这是分布式集群环境下,如何实现session共享系列的第五篇.在上一篇:分布式集群环境下,如何实现session共享四(部署项目测试)中,针对nginx不同的负载均衡策略:轮询.ip_hash方式,测 ...
- elasticsearch 备份和恢复
curl : http://keenwon.com/1393.html During snapshot initialization, information about all previous ...
- day03 内部类
- 51Nod 1126 求递推序列的第N项(矩阵快速幂)
#include <iostream> #include <algorithm> #include <cmath> #define MOD 7 #define N ...
- iOS开发 - 多线程实现方案之Pthread篇
pthread基础 pthread是POSIX thread的简写,一套通用的多线程API,适用于Unix.Linux.Windows等系统,跨平台.可移植,使用难度大,C语言框架,线程生命周期由程序 ...
- Linux —— 文件搜索命令
文件搜索命令(配置文件/etc/updatedb.conf) locate 文件名 搜索速度非常快 在后台数据库中按照文件名搜索 updatedb 更新数据库 只可以按照文件名搜索 whereis 命 ...