<!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>

最新文章

  1. Android APP 简单高效的禁用横竖屏切换
  2. BZOJ 1041: [HAOI2008]圆上的整点
  3. AndroidStudio开发环境配置-Windows
  4. 从人类社会的角度看OO(独家视角)
  5. [Python] Python学习笔记之常用模块总结[持续更新...]
  6. Thinking in Java——笔记(18)
  7. OpenLayers工作原理
  8. Jasmine入门(上)
  9. 【Android】YUV使用总结 —— Android常用的几种格式:NV21/NV12/YV12/YUV420P的区别
  10. struts2中拦截器与过滤器的区别
  11. dede织梦后台如何修改?如何增加删除菜单?(
  12. Python【基础第三篇】
  13. Python自动化之session
  14. (转)HTML特殊字符
  15. WifiDog系统
  16. TreeMap 源码分析
  17. pip/pip3更换国内源
  18. MS-DOS 6.22 +Vim+masm 汇编环境
  19. OpenStack之Neutron分配VIP提供给两台虚拟机做高可用
  20. eclipse 代码模板

热门文章

  1. Unity3D中常用的数据结构总结与分
  2. poj2133(sg函数)
  3. 反射记录点滴——Field
  4. XML学习1 xml序言 dtd约束
  5. tinymce 富文本简单使用
  6. [題解](縮點)luogu_P2341受歡迎的牛
  7. Hungary Algorithm国外板子
  8. 116 Populating Next Right Pointers in Each Node 每个节点的右向指针
  9. 正则表达式匹配URL——给URL地址加上&lt;a&gt; 链接
  10. JMeter--PerfMon Metrics Collector监控内存及CPU