<!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的拍摄效果的更多相关文章

  1. jQuery属性/CSS使用例子

    jQuery属性/CSS 1..attr() 获取匹配的元素集合中的第一个元素的属性的值  或 设置每一个匹配元素的一个或多个属性. 例1:获取元素的属性的值 <p title="段落 ...

  2. jquery的css详解(二)

    jq的工具方法style用于设置样式,jq的实例方法css在设置样式时就是调用的它,接下来分析一下源码. jQuery.extend({ ............................ st ...

  3. jquery的css详解(一)

    通过阅读源码可以发现css是jq的实例方法.而在内部调用jq的工具方法access来实现的,对该方法不了解的朋友请点击 -> jquery工具方法access详解 在access的回调中做了一个 ...

  4. jquery修改css样式,样式带!important

    由于需求的需要,今天在用jquery修改一个弹出框的样式的时候,由于有一个按钮有padding-left:12px;导致内间距空出来的这一块颜色用普通的方式无法改变. 普通的jquery修改css的方 ...

  5. 使用jquery修改css中带有!important的样式属性

    当CSS中含有!important的样式属性时,普通的修改方式是会出现失败的.如下: <div class="test">使用jquery修改css中带有!import ...

  6. jquery和css自定义video播放控件

    下面介绍一下通过jquery和css自定义video播放控件. Html5 Video是现在html5最流行的功能之一,得到了大多数最新版本的浏览器支持.包括IE9,也是如此.不同的浏览器提供了不同的 ...

  7. 在线运行Javascript,Jquery,HTML,CSS代码

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xht ...

  8. JQuery:JQuery操作CSS类

    JQuery:CSS类jQuery - 获取并设置 CSS 类,通过 jQuery,可以很容易地对 CSS 元素进行操作.jQuery 操作 CSSjQuery 拥有若干进行 CSS 操作的方法.我们 ...

  9. jQuery和CSS 3定制HTML 5视频播放器

    目前,随着越来越多的浏览器开始支持更多的HTML5新特性,开发者也逐渐关注HTML5的开发.在众多HTML5的新特性中,视频方面的新特性是 很值得开发者和用户关注的.现在,只需要有支持HTML5的浏览 ...

随机推荐

  1. lightoj 1078【同余定理】

    题意: 给你一个n和一个数 digit ,问你最少需要多少个 digit 使得整除于n; 思路: 同余定理(a+b)%n=(a%n+b%n)%n; (m%n+m%n*10+m%n*100+m%n*10 ...

  2. Codevs 3112 二叉树计数

    3112 二叉树计数 题目描述 Description 一个有n个结点的二叉树总共有多少种形态 输入描述 Input Description 读入一个正整数n 输出描述 Output Descript ...

  3. 阿里云物联网 .NET Core 客户端 | CZGL.AliIoTClient:4. 设备上报属性

    文档目录: 说明 1. 连接阿里云物联网 2. IoT 客户端 3. 订阅Topic与响应Topic 4. 设备上报属性 4.1 上报位置信息 5. 设置设备属性 6. 设备事件上报 7. 服务调用 ...

  4. C#连接Sqlite实现单表操作

    今天我们来了解下VS使用的众多数据库中比较轻量的数据库SQLITE,好处当然就在于“轻~”!!!.自己理解

  5. 最新的vue没有dev-server.js文件,如何进行后台数据模拟?

    最新的vue里dev-server.js被替换成了webpack-dev-conf.js 在模拟后台数据的时候直接在webpack-dev-conf.js文件中修改 第一步,在const portfi ...

  6. Centos5.11 使用yum源

    由于我是用的系统是Centos 5.11以停止更新很多年,故此yum也不能用,找了很多方法,最终yum能稳定的运行在Centos5.11上,下面开始一一讲解步骤: 1:首先更新yum源 地址:http ...

  7. Java三种技术架构

    http://blog.csdn.net/weixin_36416990/article/details/52845868

  8. requests发送HTTPS请求(处理SSL证书验证)

    1.SSL是什么,为什么发送HTTPS请求时需要证书验证? 1.1 SSL:安全套接字层.是为了解决HTTP协议是明文,避免传输的数据被窃取,篡改,劫持等. 1.2 TSL:Transport Lay ...

  9. [在读]HTML5数据推送应用开发

    最近买的,讲SSE的,才看完前2章.

  10. django-Haystack库

    本文参考自Haystack官方文档:https://django-haystack.readthedocs.io/en/master/tutorial.html#configuration 简介 Ha ...