利用fancyboxjquery弹出div窗口一个div,加载失败.是咋回事

拒绝访问 | it. | 百度云加速
请打开cookies.
此网站 (it.) 的管理员禁止了您的访问。原因是您的访问包含了非浏览器特征(3b13c-ua98).
重新安装浏览器,或使用别的浏览器  fancybox可以弹出很多窗体,甚至一个swf格式的小视频。但这样的swf视频播放的时候并没有任何的控件。只能重头看到尾,或者关闭。我们可以利用fancybox弹出div盒子的方式配合html5很快的写出弹出一个小视频的代码。首先,效果如下图所示。点击播放的图片,弹出播放视频。背景自动虚化。
  首先引入fancybox文件,可以再下载,注意图片文件也要放进网页目录。
&link rel="stylesheet" type="text/css" href="css/fancybox.css" /&
&script type="text/javascript" src="js/jquery-1.11.3.js"&&/script&
&script type="text/javascript" src="js/jquery.fancybox-1.3.1.pack.js"&&/script&
&script type="text/javascript" src="js/main.js"&&/script&
  然后是html部分
&a id="showdiv1" href="#box1" title="测试"&&img src="images/play.PNG" /&&/a&&!--存放播放的图标,可以是img,button等等--!&
style="display:none"&&!--先让div隐藏--!&
&div id="box1"&
&video id="movie" src="movie/1.MP4" controls="controls" preload="meta"&&/video&
  最后是js部分
$(document).ready(function(){
$("#showdiv1").fancybox({
padding:0,
hideOnOverlayClick:false,
fitToView:false,
autoSize:true,
closeClick:true,
openEffect:"none",
closeEffect:"none",
"onClosed":function(){window.document.location.reload(true)},
centerOnScroll:true
&  最后可以自己稍作改动,做到自己想要的效果
阅读(...) 评论()插件与系统命令
对于很多JS弹框插件来说,都提供了alter,confirm等功能,如fancybox,Boxy等插件,今天来介绍一下如何将系统的alter和confirm替换成指定插件的alter和confirm,使用替换的方式的好处就是不用修改之前的代码,这在面向对象里,
叫做&对修改关闭,对扩展开放&,也称为OCP原则,即开闭原则。
fancybox替换系统命令,它需要有一个HTML容器来展现弹框
&script id="MessageBox_delete" type="text/html"&
&!--试题删除确认弹出框 start--&
&div class="r_warnBox" style="width: 276"&
&div class="r_warnBox_tit"&
&h3&&strong&提示&/strong&&/h3&
&div class="r_roomBoxContDel"&
&p class="alert"&您确定删除作业吗?&/p&
&p class="confirm"&&a class="sure" href="javascript:;"&确定&/a&&a class="cancel" href="javascript:;" onclick="$.fancybox.close();"&取消&/a&&/p&
&a class="r_warnBox_close" href="javascript:;" onclick="$.fancybox.close();"&&/a&
&!--试题删除确认弹出框 end--&
&!--弹出框1 start--&
&script id="MessageBox_message" type="text/html"&
&div class='r_warnBox' style='width: 433 padding-right: 30'&
&div class='r_warnBox_tit'&
&h3&&strong&提示
&/strong&&/h3&
&div id='alert_message' class='r_roomBoxCont'&
&p class='alert'&[Content]&/p&
&a class='r_warnBox_close' href='javascript:;' onclick="$.fancybox.close()"&&/a&
&!--弹出框1 end--&
下面是复写语句
window.alert = function (msg) {
var reg = new RegExp("\\[([^\\[\\]]*?)\\]", 'igm'); //i g m是指分别用于指定区分大小写的匹配、全局匹配和多行匹配。
var html = document.getElementById("MessageBox_message").innerHTML;
var result = html.replace(reg, function (node, key) { return { 'Content': msg }[key]; });
$.fancybox(result, {
'padding': 0,
'scrolling': 'visible',
'closeBtn': false,
'modal': false
window.confirm = function (msg, callBack) {
$.fancybox($("#MessageBox_delete").html(), {
'padding': 0,
'scrolling': 'visible',
'closeBtn': false,
'modal': false,
afterShow: function () {
$('p.confirm a.sure').on('click', function () {
callBack();
下面是调用语句
function alerttest() {
alert("ok");
function confirmtest() {
confirm("are you sure!", function () { alert("删除成功") });
Boxy替换系统命令,使用相对简单,它已经为我们创建的弹框的DIV
window.alert = function (msg) {
Boxy.alert(msg);
window.alert = function (msg,callback) {
Boxy.confirm(msg,callback);
调用和fancybox也是一样的
function alerttest() {
alert("ok");
function confirmtest() {
confirm("are you sure!", function () { alert("删除成功") });
最后运行效果如图
阅读(...) 评论()带图像放大的jQuery展示画廊,fancybox效果 展示 jquery.fancybox-1.3.4.js源代码
- 下载整个 - 类型:.js文件
&* FancyBox - jQuery Plugin
&* Simple and fancy lightbox alternative
&* Download by
&* Examples and documentation at: http://fancybox.net
&* Copyright (c) 2008 - 2010 Janis Skarnelis
&* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
&* Version: 1.3.4 (11/11/2010)
&* Requires: jQuery v1.3+
&* Dual licensed under the MIT and GPL licenses:
&* & http://www.opensource.org/licenses/mit-license.php
&* & http://www.gnu.org/licenses/gpl.html
;(function($) {
& & & & var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right,
& & & & & & & & selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [],
& & & & & & & & ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i,
& & & & & & & & loadingTimer, loadingFrame = 1,
& & & & & & & & titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('&div/&')[0], { prop: 0 }),
& & & & & & & & isIE6 = $.browser.msie && $.browser.version & 7 && !window.XMLHttpRequest,
& & & & & & & & /*
& & & & & & & & &* Private methods
& & & & & & & & &*/
& & & & & & & & _abort = function() {
& & & & & & & & & & & & loading.hide();
& & & & & & & & & & & & imgPreloader.onerror = imgPreloader.onload = null;
& & & & & & & & & & & & if (ajaxLoader) {
& & & & & & & & & & & & & & & & ajaxLoader.abort();
& & & & & & & & & & & & }
& & & & & & & & & & & & tmp.empty();
& & & & & & & & },
& & & & & & & & _error = function() {
& & & & & & & & & & & & if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) {
& & & & & & & & & & & & & & & & loading.hide();
& & & & & & & & & & & & & & & & busy = false;
& & & & & & & & & & & & & & & & return;
& & & & & & & & & & & & }
& & & & & & & & & & & & selectedOpts.titleShow = false;
& & & & & & & & & & & & selectedOpts.width = 'auto';
& & & & & & & & & & & & selectedOpts.height = 'auto';
& & & & & & & & & & & & tmp.html( '&p id=&fancybox-error&&The requested content cannot be loaded.&br /&Please try again later.&/p&' );
& & & & & & & & & & & & _process_inline();
& & & & & & & & },
& & & & & & & & _start = function() {
& & & & & & & & & & & & var obj = selectedArray[ selectedIndex ],
& & & & & & & & & & & & & & & & href,
& & & & & & & & & & & & & & & & type,
& & & & & & & & & & & & & & & & title,
& & & & & & & & & & & & & & & & str,
& & & & & & & & & & & & & & & & emb,
& & & & & & & & & & & & & & & & ret;
& & & & & & & & & & & & _abort();
& & & & & & & & & & & & selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox')));
& & & & & & & & & & & & ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts);
& & & & & & & & & & & & if (ret === false) {
& & & & & & & & & & & & & & & & busy = false;
& & & & & & & & & & & & & & & & return;
& & & & & & & & & & & & } else if (typeof ret == 'object') {
& & & & & & & & & & & & & & & & selectedOpts = $.extend(selectedOpts, ret);
& & & & & & & & & & & & }
& & & & & & & & & & & & title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || '';
& & & & & & & & & & & & if (obj.nodeName && !selectedOpts.orig) {
& & & & & & & & & & & & & & & & selectedOpts.orig = $(obj).children(&img:first&).length ? $(obj).children(&img:first&) : $(obj);
& & & & & & & & & & & & }
& & & & & & & & & & & & if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) {
& & & & & & & & & & & & & & & & title = selectedOpts.orig.attr('alt');
& & & & & & & & & & & & }
& & & & & & & & & & & & href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;
& & & & & & & & & & & & if ((/^(?:javascript)/i).test(href) || href == '#') {
& & & & & & & & & & & & & & & & href = null;
& & & & & & & & & & & & }
& & & & & & & & & & & & if (selectedOpts.type) {
& & & & & & & & & & & & & & & & type = selectedOpts.type;
& & & & & & & & & & & & & & & & if (!href) {
& & & & & & & & & & & & & & & & & & & & href = selectedOpts.content;
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & } else if (selectedOpts.content) {
& & & & & & & & & & & & & & & & type = 'html';
& & & & & & & & & & & & } else if (href) {
& & & & & & & & & & & & & & & & if (href.match(imgRegExp)) {
& & & & & & & & & & & & & & & & & & & & type = 'image';
& & & & & & & & & & & & & & & & } else if (href.match(swfRegExp)) {
& & & & & & & & & & & & & & & & & & & & type = 'swf';
& & & & & & & & & & & & & & & & } else if ($(obj).hasClass(&iframe&)) {
& & & & & & & & & & & & & & & & & & & & type = 'iframe';
& & & & & & & & & & & & & & & & } else if (href.indexOf(&#&) === 0) {
& & & & & & & & & & & & & & & & & & & & type = 'inline';
& & & & & & & & & & & & & & & & } else {
& & & & & & & & & & & & & & & & & & & & type = 'ajax';
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & }
& & & & & & & & & & & & if (!type) {
& & & & & & & & & & & & & & & & _error();
& & & & & & & & & & & & & & & & return;
& & & & & & & & & & & & }
& & & & & & & & & & & & if (type == 'inline') {
& & & & & & & & & & & & & & & & obj & & = href.substr(href.indexOf(&#&));
& & & & & & & & & & & & & & & & type = $(obj).length & 0 ? 'inline' : 'ajax';
& & & & & & & & & & & & }
& & & & & & & & & & & & selectedOpts.type = type;
& & & & & & & & & & & & selectedOpts.href = href;
& & & & & & & & & & & & selectedOpts.title = title;
& & & & & & & & & & & & if (selectedOpts.autoDimensions) {
& & & & & & & & & & & & & & & & if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') {
& & & & & & & & & & & & & & & & & & & & selectedOpts.width = 'auto';
& & & & & & & & & & & & & & & & & & & & selectedOpts.height = 'auto';
& & & & & & & & & & & & & & & & } else {
& & & & & & & & & & & & & & & & & & & & selectedOpts.autoDimensions = false;& &
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & }
& & & & & & & & & & & & if (selectedOpts.modal) {
& & & & & & & & & & & & & & & & selectedOpts.overlayShow = true;
& & & & & & & & & & & & & & & & selectedOpts.hideOnOverlayClick = false;
& & & & & & & & & & & & & & & & selectedOpts.hideOnContentClick = false;
& & & & & & & & & & & & & & & & selectedOpts.enableEscapeButton = false;
& & & & & & & & & & & & & & & & selectedOpts.showCloseButton = false;
& & & & & & & & & & & & }
& & & & & & & & & & & & selectedOpts.padding = parseInt(selectedOpts.padding, 10);
& & & & & & & & & & & & selectedOpts.margin = parseInt(selectedOpts.margin, 10);
& & & & & & & & & & & & tmp.css('padding', (selectedOpts.padding + selectedOpts.margin));
& & & & & & & & & & & & $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() {
& & & & & & & & & & & & & & & & $(this).replaceWith(content.children());& & & & & & & & & & & & & & & &
& & & & & & & & & & & & });
& & & & & & & & & & & & switch (type) {
& & & & & & & & & & & & & & & & case 'html' :
& & & & & & & & & & & & & & & & & & & & tmp.html( selectedOpts.content );
& & & & & & & & & & & & & & & & & & & & _process_inline();
& & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & case 'inline' :
& & & & & & & & & & & & & & & & & & & & if ( $(obj).parent().is('#fancybox-content') === true) {
& & & & & & & & & & & & & & & & & & & & & & & & busy = false;
& & & & & & & & & & & & & & & & & & & & & & & & return;
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & $('&div class=&fancybox-inline-tmp& /&')
& & & & & & & & & & & & & & & & & & & & & & & & .hide()
& & & & & & & & & & & & & & & & & & & & & & & & .insertBefore( $(obj) )
& & & & & & & & & & & & & & & & & & & & & & & & .bind('fancybox-cleanup', function() {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & $(this).replaceWith(content.children());
& & & & & & & & & & & & & & & & & & & & & & & & }).bind('fancybox-cancel', function() {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & $(this).replaceWith(tmp.children());
& & & & & & & & & & & & & & & & & & & & & & & & });
& & & & & & & & & & & & & & & & & & & & $(obj).appendTo(tmp);
& & & & & & & & & & & & & & & & & & & & _process_inline();
& & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & case 'image':
& & & & & & & & & & & & & & & & & & & & busy = false;
& & & & & & & & & & & & & & & & & & & & $.fancybox.showActivity();
& & & & & & & & & & & & & & & & & & & & imgPreloader = new Image();
& & & & & & & & & & & & & & & & & & & & imgPreloader.onerror = function() {
& & & & & & & & & & & & & & & & & & & & & & & & _error();
& & & & & & & & & & & & & & & & & & & & };
& & & & & & & & & & & & & & & & & & & & imgPreloader.onload = function() {
& & & & & & & & & & & & & & & & & & & & & & & & busy = true;
& & & & & & & & & & & & & & & & & & & & & & & & imgPreloader.onerror = imgPreloader.onload = null;
& & & & & & & & & & & & & & & & & & & & & & & & _process_image();
& & & & & & & & & & & & & & & & & & & & };
& & & & & & & & & & & & & & & & & & & & imgPreloader.src = href;
& & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & case 'swf':
& & & & & & & & & & & & & & & & & & & & selectedOpts.scrolling = 'no';
& & & & & & & & & & & & & & & & & & & & str = '&object classid=&clsid:D27CDB6E-AE6D-11cf-96B8-& width=&' + selectedOpts.width + '& height=&' + selectedOpts.height + '&&&param name=&movie& value=&' + href + '&&&/param&';
& & & & & & & & & & & & & & & & & & & & emb = '';
& & & & & & & & & & & & & & & & & & & & $.each(selectedOpts.swf, function(name, val) {
& & & & & & & & & & & & & & & & & & & & & & & & str += '&param name=&' + name + '& value=&' + val + '&&&/param&';
& & & & & & & & & & & & & & & & & & & & & & & & emb += ' ' + name + '=&' + val + '&';
& & & & & & & & & & & & & & & & & & & & });
& & & & & & & & & & & & & & & & & & & & str += '&embed src=&' + href + '& type=&application/x-shockwave-flash& width=&' + selectedOpts.width + '& height=&' + selectedOpts.height + '&' + emb + '&&/embed&&/object&';
& & & & & & & & & & & & & & & & & & & & tmp.html(str);
& & & & & & & & & & & & & & & & & & & & _process_inline();
& & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & case 'ajax':
& & & & & & & & & & & & & & & & & & & & busy = false;
& & & & & & & & & & & & & & & & & & & & $.fancybox.showActivity();
& & & & & & & & & & & & & & & & & & & & selectedOpts.ajax.win = selectedOpts.ajax.success;
& & & & & & & & & & & & & & & & & & & & ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, {
& & & & & & & & & & & & & & & & & & & & & & & & url & & : href,
& & & & & & & & & & & & & & & & & & & & & & & & data : selectedOpts.ajax.data || {},
& & & & & & & & & & & & & & & & & & & & & & & & error : function(XMLHttpRequest, textStatus, errorThrown) {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & if ( XMLHttpRequest.status & 0 ) {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & _error();
& & & & & & & & & & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & & & & & },
& & & & & & & & & & & & & & & & & & & & & & & & success : function(data, textStatus, XMLHttpRequest) {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader;
& & & & & & & & & & & & & & & & & & & & & & & & & & & & if (o.status == 200) {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & if ( typeof selectedOpts.ajax.win == 'function' ) {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest);
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & if (ret === false) {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & loading.hide();
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & return;
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & } else if (typeof ret == 'string' || typeof ret == 'object') {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & data = ret;
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & tmp.html( data );
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & _process_inline();
& & & & & & & & & & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & }));
& & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & case 'iframe':
& & & & & & & & & & & & & & & & & & & & _show();
& & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & }
& & & & & & & & },
& & & & & & & & _process_inline = function() {
& & & & & & & & & & & & var
& & & & & & & & & & & & & & & & w = selectedOpts.width,
& & & & & & & & & & & & & & & & h = selectedOpts.height;
& & & & & & & & & & & & if (w.toString().indexOf('%') & -1) {
& & & & & & & & & & & & & & & & w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px';
& & & & & & & & & & & & } else {
& & & & & & & & & & & & & & & & w = w == 'auto' ? 'auto' : w + 'px';& &
& & & & & & & & & & & & }
& & & & & & & & & & & & if (h.toString().indexOf('%') & -1) {
& & & & & & & & & & & & & & & & h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px';
& & & & & & & & & & & & } else {
& & & & & & & & & & & & & & & & h = h == 'auto' ? 'auto' : h + 'px';& &
& & & & & & & & & & & & }
& & & & & & & & & & & & tmp.wrapInner('&div style=&width:' + w + ';height:' + h + ';overflow: ' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:&&&/div&');
& & & & & & & & & & & & selectedOpts.width = tmp.width();
& & & & & & & & & & & & selectedOpts.height = tmp.height();
& & & & & & & & & & & & _show();
& & & & & & & & },
& & & & & & & & _process_image = function() {
& & & & & & & & & & & & selectedOpts.width = imgPreloader.width;
& & & & & & & & & & & & selectedOpts.height = imgPreloader.height;
& & & & & & & & & & & & $(&&img /&&).attr({
& & & & & & & & & & & & & & & & 'id' : 'fancybox-img',
& & & & & & & & & & & & & & & & 'src' : imgPreloader.src,
& & & & & & & & & & & & & & & & 'alt' : selectedOpts.title
& & & & & & & & & & & & }).appendTo( tmp );
& & & & & & & & & & & & _show();
& & & & & & & & },
& & & & & & & & _show = function() {
& & & & & & & & & & & & var pos, equal;
& & & & & & & & & & & & loading.hide();
& & & & & & & & & & & & if (wrap.is(&:visible&) && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
& & & & & & & & & & & & & & & & $.event.trigger('fancybox-cancel');
& & & & & & & & & & & & & & & & busy = false;
& & & & & & & & & & & & & & & & return;
& & & & & & & & & & & & }
& & & & & & & & & & & & busy = true;
& & & & & & & & & & & & $(content.add( overlay )).unbind();
& & & & & & & & & & & & $(window).unbind(&resize.fb scroll.fb&);
& & & & & & & & & & & & $(document).unbind('keydown.fb');
& & & & & & & & & & & & if (wrap.is(&:visible&) && currentOpts.titlePosition !== 'outside') {
& & & & & & & & & & & & & & & & wrap.css('height', wrap.height());
& & & & & & & & & & & & }
& & & & & & & & & & & & currentArray = selectedArray;
& & & & & & & & & & & & currentIndex = selectedIndex;
& & & & & & & & & & & & currentOpts = selectedOpts;
& & & & & & & & & & & & if (currentOpts.overlayShow) {
& & & & & & & & & & & & & & & & overlay.css({
& & & & & & & & & & & & & & & & & & & & 'background-color' : currentOpts.overlayColor,
& & & & & & & & & & & & & & & & & & & & 'opacity' : currentOpts.overlayOpacity,
& & & & & & & & & & & & & & & & & & & & 'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto',
& & & & & & & & & & & & & & & & & & & & 'height' : $(document).height()
& & & & & & & & & & & & & & & & });
& & & & & & & & & & & & & & & & if (!overlay.is(':visible')) {
& & & & & & & & & & & & & & & & & & & & if (isIE6) {
& & & & & & & & & & & & & & & & & & & & & & & & $('select:not(#fancybox-tmp select)').filter(function() {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & return this.style.visibility !== 'hidden';
& & & & & & & & & & & & & & & & & & & & & & & & }).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & this.style.visibility = 'inherit';
& & & & & & & & & & & & & & & & & & & & & & & & });
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & overlay.show();
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & } else {
& & & & & & & & & & & & & & & & overlay.hide();
& & & & & & & & & & & & }
& & & & & & & & & & & & final_pos = _get_zoom_to();
& & & & & & & & & & & & _process_title();
& & & & & & & & & & & & if (wrap.is(&:visible&)) {
& & & & & & & & & & & & & & & & $( close.add( nav_left ).add( nav_right ) );
& & & & & & & & & & & & & & & & pos = wrap.position(),
& & & & & & & & & & & & & & & & start_pos = {
& & & & & & & & & & & & & & & & & & & & top & & &: pos.top,
& & & & & & & & & & & & & & & & & & & & left : pos.left,
& & & & & & & & & & & & & & & & & & & & width : wrap.width(),
& & & & & & & & & & & & & & & & & & & & height : wrap.height()
& & & & & & & & & & & & & & & & };
& & & & & & & & & & & & & & & & equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height);
& & & & & & & & & & & & & & & & content.fadeTo(currentOpts.changeFade, 0.3, function() {
& & & & & & & & & & & & & & & & & & & & var finish_resizing = function() {
& & & & & & & & & & & & & & & & & & & & & & & & content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish);
& & & & & & & & & & & & & & & & & & & & };
& & & & & & & & & & & & & & & & & & & & $.event.trigger('fancybox-change');
& & & & & & & & & & & & & & & & & & & & content
& & & & & & & & & & & & & & & & & & & & & & & & .empty()
& & & & & & & & & & & & & & & & & & & & & & & & .removeAttr('filter')
& & & & & & & & & & & & & & & & & & & & & & & & .css({
& & & & & & & & & & & & & & & & & & & & & & & & & & & & 'border-width' : currentOpts.padding,
& & & & & & & & & & & & & & & & & & & & & & & & & & & & 'width' : final_pos.width - currentOpts.padding * 2,
& & & & & & & & & & & & & & & & & & & & & & & & & & & & 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
& & & & & & & & & & & & & & & & & & & & & & & & });
& & & & & & & & & & & & & & & & & & & & if (equal) {
& & & & & & & & & & & & & & & & & & & & & & & & finish_resizing();
& & & & & & & & & & & & & & & & & & & & } else {
& & & & & & & & & & & & & & & & & & & & & & & & fx.prop = 0;
& & & & & & & & & & & & & & & & & & & & & & & & $(fx).animate({prop: 1}, {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & &duration : currentOpts.changeSpeed,
& & & & & & & & & & & & & & & & & & & & & & & & & & & & &easing : currentOpts.easingChange,
& & & & & & & & & & & & & & & & & & & & & & & & & & & & &step : _draw,
& & & & & & & & & & & & & & & & & & & & & & & & & & & & &complete : finish_resizing
& & & & & & & & & & & & & & & & & & & & & & & & });
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & });
& & & & & & & & & & & & & & & & return;
& & & & & & & & & & & & }
& & & & & & & & & & & & wrap.removeAttr(&style&);
& & & & & & & & & & & & content.css('border-width', currentOpts.padding);
& & & & & & & & & & & & if (currentOpts.transitionIn == 'elastic') {
& & & & & & & & & & & & & & & & start_pos = _get_zoom_from();
& & & & & & & & & & & & & & & & content.html( tmp.contents() );
& & & & & & & & & & & & & & & & wrap.show();
& & & & & & & & & & & & & & & & if (currentOpts.opacity) {
& & & & & & & & & & & & & & & & & & & & final_pos.opacity = 0;
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & fx.prop = 0;
& & & & & & & & & & & & & & & & $(fx).animate({prop: 1}, {
& & & & & & & & & & & & & & & & & & & & &duration : currentOpts.speedIn,
& & & & & & & & & & & & & & & & & & & & &easing : currentOpts.easingIn,
& & & & & & & & & & & & & & & & & & & & &step : _draw,
& & & & & & & & & & & & & & & & & & & & &complete : _finish
& & & & & & & & & & & & & & & & });
& & & & & & & & & & & & & & & & return;
& & & & & & & & & & & & }
& & & & & & & & & & & & if (currentOpts.titlePosition == 'inside' && titleHeight & 0) {
& & & & & & & & & & & & & & & & title.show(); &
& & & & & & & & & & & & }
& & & & & & & & & & & & content
& & & & & & & & & & & & & & & & .css({
& & & & & & & & & & & & & & & & & & & & 'width' : final_pos.width - currentOpts.padding * 2,
& & & & & & & & & & & & & & & & & & & & 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
& & & & & & & & & & & & & & & & })
& & & & & & & & & & & & & & & & .html( tmp.contents() );
& & & & & & & & & & & & wrap
& & & & & & & & & & & & & & & & .css(final_pos)
& & & & & & & & & & & & & & & & .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish );
& & & & & & & & },
& & & & & & & & _format_title = function(title) {
& & & & & & & & & & & & if (title && title.length) {
& & & & & & & & & & & & & & & & if (currentOpts.titlePosition == 'float') {
& & & & & & & & & & & & & & & & & & & & return '&table id=&fancybox-title-float-wrap& cellpadding=&0& cellspacing=&0&&&tr&&td id=&fancybox-title-float-left&&&/td&&td id=&fancybox-title-float-main&&' + title + '&/td&&td id=&fancybox-title-float-right&&&/td&&/tr&&/table&';
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & return '&div id=&fancybox-title-' + currentOpts.titlePosition + '&&' + title + '&/div&';
& & & & & & & & & & & & }
& & & & & & & & & & & & return false;
& & & & & & & & },
& & & & & & & & _process_title = function() {
& & & & & & & & & & & & titleStr = currentOpts.title || '';
& & & & & & & & & & & & titleHeight = 0;
& & & & & & & & & & & & title
& & & & & & & & & & & & & & & & .empty()
& & & & & & & & & & & & & & & & .removeAttr('style')
& & & & & & & & & & & & & & & & .removeClass();
& & & & & & & & & & & & if (currentOpts.titleShow === false) {
& & & & & & & & & & & & & & & & title.hide();
& & & & & & & & & & & & & & & & return;
& & & & & & & & & & & & }
& & & & & & & & & & & & titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr);
& & & & & & & & & & & & if (!titleStr || titleStr === '') {
& & & & & & & & & & & & & & & & title.hide();
& & & & & & & & & & & & & & & & return;
& & & & & & & & & & & & }
& & & & & & & & & & & & title
& & & & & & & & & & & & & & & & .addClass('fancybox-title-' + currentOpts.titlePosition)
& & & & & & & & & & & & & & & & .html( titleStr )
& & & & & & & & & & & & & & & & .appendTo( 'body' )
& & & & & & & & & & & & & & & & .show();
& & & & & & & & & & & & switch (currentOpts.titlePosition) {
& & & & & & & & & & & & & & & & case 'inside':
& & & & & & & & & & & & & & & & & & & & title
& & & & & & & & & & & & & & & & & & & & & & & & .css({
& & & & & & & & & & & & & & & & & & & & & & & & & & & & 'width' : final_pos.width - (currentOpts.padding * 2),
& & & & & & & & & & & & & & & & & & & & & & & & & & & & 'marginLeft' : currentOpts.padding,
& & & & & & & & & & & & & & & & & & & & & & & & & & & & 'marginRight' : currentOpts.padding
& & & & & & & & & & & & & & & & & & & & & & & & });
& & & & & & & & & & & & & & & & & & & & titleHeight = title.outerHeight(true);
& & & & & & & & & & & & & & & & & & & & title.appendTo( outer );
& & & & & & & & & & & & & & & & & & & & final_pos.height += titleHeight;
& & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & case 'over':
& & & & & & & & & & & & & & & & & & & & title
& & & & & & & & & & & & & & & & & & & & & & & & .css({
& & & & & & & & & & & & & & & & & & & & & & & & & & & & 'marginLeft' : currentOpts.padding,
& & & & & & & & & & & & & & & & & & & & & & & & & & & & 'width' : final_pos.width - (currentOpts.padding * 2),
& & & & & & & & & & & & & & & & & & & & & & & & & & & & 'bottom' : currentOpts.padding
& & & & & & & & & & & & & & & & & & & & & & & & })
& & & & & & & & & & & & & & & & & & & & & & & & .appendTo( outer );
& & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & case 'float':
& & & & & & & & & & & & & & & & & & & & title
& & & & & & & & & & & & & & & & & & & & & & & & .css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1)
& & & & & & & & & & & & & & & & & & & & & & & & .appendTo( wrap );
& & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & default:
& & & & & & & & & & & & & & & & & & & & title
& & & & & & & & & & & & & & & & & & & & & & & & .css({
& & & & & & & & & & & & & & & & & & & & & & & & & & & & 'width' : final_pos.width - (currentOpts.padding * 2),
& & & & & & & & & & & & & & & & & & & & & & & & & & & & 'paddingLeft' : currentOpts.padding,
& & & & & & & & & & & & & & & & & & & & & & & & & & & & 'paddingRight' : currentOpts.padding
& & & & & & & & & & & & & & & & & & & & & & & & })
& & & & & & & & & & & & & & & & & & & & & & & & .appendTo( wrap );
& & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & }
& & & & & & & & & & & & title.hide();
& & & & & & & & },
& & & & & & & & _set_navigation = function() {
& & & & & & & & & & & & if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) {
& & & & & & & & & & & & & & & & $(document).bind('keydown.fb', function(e) {
& & & & & & & & & & & & & & & & & & & & if (e.keyCode == 27 && currentOpts.enableEscapeButton) {
& & & & & & & & & & & & & & & & & & & & & & & & e.preventDefault();
& & & & & & & & & & & & & & & & & & & & & & & & $.fancybox.close();
& & & & & & & & & & & & & & & & & & & & } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
& & & & & & & & & & & & & & & & & & & & & & & & e.preventDefault();
& & & & & & & & & & & & & & & & & & & & & & & & $.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & });
& & & & & & & & & & & & }
& & & & & & & & & & & & if (!currentOpts.showNavArrows) {
& & & & & & & & & & & & & & & & nav_left.hide();
& & & & & & & & & & & & & & & & nav_right.hide();
& & & & & & & & & & & & & & & & return;
& & & & & & & & & & & & }
& & & & & & & & & & & & if ((currentOpts.cyclic && currentArray.length & 1) || currentIndex !== 0) {
& & & & & & & & & & & & & & & & nav_left.show();
& & & & & & & & & & & & }
& & & & & & & & & & & & else
& & & & & & & & & & & & & & & & nav_left.hide();
& & & & & & & & & & & & if ((currentOpts.cyclic && currentArray.length & 1) || currentIndex != (currentArray.length -1)) {
& & & & & & & & & & & & & & & & nav_right.show();
& & & & & & & & & & & & }
& & & & & & & & & & & & else
& & & & & & & & & & & & & & & & nav_right.hide();
& & & & & & & & },
& & & & & & & & _finish = function () {
& & & & & & & & & & & & if (!$.support.opacity) {
& & & & & & & & & & & & & & & & content.get(0).style.removeAttribute('filter');
& & & & & & & & & & & & & & & & wrap.get(0).style.removeAttribute('filter');
& & & & & & & & & & & & }
& & & & & & & & & & & & if (selectedOpts.autoDimensions) {
& & & & & & & & & & & & & & & & content.css('height', 'auto');
& & & & & & & & & & & & }
& & & & & & & & & & & & wrap.css('height', 'auto');
& & & & & & & & & & & & if (titleStr && titleStr.length) {
& & & & & & & & & & & & & & & & title.show();
& & & & & & & & & & & & }
& & & & & & & & & & & & if (currentOpts.showCloseButton) {
& & & & & & & & & & & & & & & & close.show();
& & & & & & & & & & & & }
& & & & & & & & & & & & _set_navigation();
& & & & & & & & & & & & if (currentOpts.hideOnContentClick) & & {
& & & & & & & & & & & & & & & & content.bind('click', $.fancybox.close);
& & & & & & & & & & & & }
& & & & & & & & & & & & if (currentOpts.hideOnOverlayClick) & & {
& & & & & & & & & & & & & & & & overlay.bind('click', $.fancybox.close);
& & & & & & & & & & & & }
& & & & & & & & & & & & $(window).bind(&resize.fb&, $.fancybox.resize);
& & & & & & & & & & & & if (currentOpts.centerOnScroll) {
& & & & & & & & & & & & & & & & $(window).bind(&scroll.fb&, $.fancybox.center);
& & & & & & & & & & & & }
& & & & & & & & & & & & if (currentOpts.type == 'iframe') {
& & & & & & & & & & & & & & & & $('&iframe id=&fancybox-frame& name=&fancybox-frame' + new Date().getTime() + '& frameborder=&0& hspace=&0& ' + ($.browser.msie ? 'allowtransparency=&true&&' : '') + ' scrolling=&' + selectedOpts.scrolling + '& src=&' + currentOpts.href + '&&&/iframe&').appendTo(content);
& & & & & & & & & & & & }
& & & & & & & & & & & & wrap.show();
& & & & & & & & & & & & busy = false;
& & & & & & & & & & & & $.fancybox.center();
& & & & & & & & & & & & currentOpts.onComplete(currentArray, currentIndex, currentOpts);
& & & & & & & & & & & & _preload_images();
& & & & & & & & },
& & & & & & & & _preload_images = function() {
& & & & & & & & & & & & var href,
& & & & & & & & & & & & & & & & objNext;
& & & & & & & & & & & & if ((currentArray.length -1) & currentIndex) {
& & & & & & & & & & & & & & & & href = currentArray[ currentIndex + 1 ].href;
& & & & & & & & & & & & & & & & if (typeof href !== 'undefined' && href.match(imgRegExp)) {
& & & & & & & & & & & & & & & & & & & & objNext = new Image();
& & & & & & & & & & & & & & & & & & & & objNext.src = href;
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & }
& & & & & & & & & & & & if (currentIndex & 0) {
& & & & & & & & & & & & & & & & href = currentArray[ currentIndex - 1 ].href;
& & & & & & & & & & & & & & & & if (typeof href !== 'undefined' && href.match(imgRegExp)) {
& & & & & & & & & & & & & & & & & & & & objNext = new Image();
& & & & & & & & & & & & & & & & & & & & objNext.src = href;
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & }
& & & & & & & & },
& & & & & & & & _draw = function(pos) {
& & & & & & & & & & & & var dim = {
& & & & & & & & & & & & & & & & width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10),
& & & & & & & & & & & & & & & & height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10),
& & & & & & & & & & & & & & & & top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10),
& & & & & & & & & & & & & & & & left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10)
& & & & & & & & & & & & };
& & & & & & & & & & & & if (typeof final_pos.opacity !== 'undefined') {
& & & & & & & & & & & & & & & & dim.opacity = pos & 0.5 ? 0.5 : pos;
& & & & & & & & & & & & }
& & & & & & & & & & & & wrap.css(dim);
& & & & & & & & & & & & content.css({
& & & & & & & & & & & & & & & & 'width' : dim.width - currentOpts.padding * 2,
& & & & & & & & & & & & & & & & 'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2
& & & & & & & & & & & & });
& & & & & & & & },
& & & & & & & & _get_viewport = function() {
& & & & & & & & & & & & return [
& & & & & & & & & & & & & & & & $(window).width() - (currentOpts.margin * 2),
& & & & & & & & & & & & & & & & $(window).height() - (currentOpts.margin * 2),
& & & & & & & & & & & & & & & & $(document).scrollLeft() + currentOpts.margin,
& & & & & & & & & & & & & & & & $(document).scrollTop() + currentOpts.margin
& & & & & & & & & & & & ];
& & & & & & & & },
& & & & & & & & _get_zoom_to = function () {
& & & & & & & & & & & & var view = _get_viewport(),
& & & & & & & & & & & & & & & & to = {},
& & & & & & & & & & & & & & & & resize = currentOpts.autoScale,
& & & & & & & & & & & & & & & & double_padding = currentOpts.padding * 2,
& & & & & & & & & & & & & & & & ratio;
& & & & & & & & & & & & if (currentOpts.width.toString().indexOf('%') & -1) {
& & & & & & & & & & & & & & & & to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10);
& & & & & & & & & & & & } else {
& & & & & & & & & & & & & & & & to.width = currentOpts.width + double_padding;
& & & & & & & & & & & & }
& & & & & & & & & & & & if (currentOpts.height.toString().indexOf('%') & -1) {
& & & & & & & & & & & & & & & & to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10);
& & & & & & & & & & & & } else {
& & & & & & & & & & & & & & & & to.height = currentOpts.height + double_padding;
& & & & & & & & & & & & }
& & & & & & & & & & & & if (resize && (to.width & view[0] || to.height & view[1])) {
& & & & & & & & & & & & & & & & if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') {
& & & & & & & & & & & & & & & & & & & & ratio = (currentOpts.width ) / (currentOpts.height );
& & & & & & & & & & & & & & & & & & & & if ((to.width ) & view[0]) {
& & & & & & & & & & & & & & & & & & & & & & & & to.width = view[0];
& & & & & & & & & & & & & & & & & & & & & & & & to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10);
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & if ((to.height) & view[1]) {
& & & & & & & & & & & & & & & & & & & & & & & & to.height = view[1];
& & & & & & & & & & & & & & & & & & & & & & & & to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10);
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & } else {
& & & & & & & & & & & & & & & & & & & & to.width = Math.min(to.width, view[0]);
& & & & & & & & & & & & & & & & & & & & to.height = Math.min(to.height, view[1]);
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & }
& & & & & & & & & & & & to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10);
& & & & & & & & & & & & to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10);
& & & & & & & & & & & & return to;
& & & & & & & & },
& & & & & & & & _get_obj_pos = function(obj) {
& & & & & & & & & & & & var pos = obj.offset();
& & & & & & & & & & & & pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0;
& & & & & & & & & & & & pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0;
& & & & & & & & & & & & pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0;
& & & & & & & & & & & & pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0;
& & & & & & & & & & & & pos.width = obj.width();
& & & & & & & & & & & & pos.height = obj.height();
& & & & & & & & & & & & return pos;
& & & & & & & & },
& & & & & & & & _get_zoom_from = function() {
& & & & & & & & & & & & var orig = selectedOpts.orig ? $(selectedOpts.orig) : false,
& & & & & & & & & & & & & & & & from = {},
& & & & & & & & & & & & & & & & pos,
& & & & & & & & & & & & & & & & view;
& & & & & & & & & & & & if (orig && orig.length) {
& & & & & & & & & & & & & & & & pos = _get_obj_pos(orig);
& & & & & & & & & & & & & & & & from = {
& & & & & & & & & & & & & & & & & & & & width : pos.width + (currentOpts.padding * 2),
& & & & & & & & & & & & & & & & & & & & height : pos.height + (currentOpts.padding * 2),
& & & & & & & & & & & & & & & & & & & & top & & : pos.top - currentOpts.padding - 20,
& & & & & & & & & & & & & & & & & & & & left : pos.left - currentOpts.padding - 20
& & & & & & & & & & & & & & & & };
& & & & & & & & & & & & } else {
& & & & & & & & & & & & & & & & view = _get_viewport();
& & & & & & & & & & & & & & & & from = {
& & & & & & & & & & & & & & & & & & & & width : currentOpts.padding * 2,
& & & & & & & & & & & & & & & & & & & & height : currentOpts.padding * 2,
& & & & & & & & & & & & & & & & & & & & top & & : parseInt(view[3] + view[1] * 0.5, 10),
& & & & & & & & & & & & & & & & & & & & left : parseInt(view[2] + view[0] * 0.5, 10)
& & & & & & & & & & & & & & & & };
& & & & & & & & & & & & }
& & & & & & & & & & & & return from;
& & & & & & & & },
& & & & & & & & _animate_loading = function() {
& & & & & & & & & & & & if (!loading.is(':visible')){
& & & & & & & & & & & & & & & & clearInterval(loadingTimer);
& & & & & & & & & & & & & & & & return;
& & & & & & & & & & & & }
& & & & & & & & & & & & $('div', loading).css('top', (loadingFrame * -40) + 'px');
& & & & & & & & & & & & loadingFrame = (loadingFrame + 1) % 12;
& & & & & & & & };
& & & & /*
& & & & &* Public methods
& & & & &*/
& & & & $.fn.fancybox = function(options) {
& & & & & & & & if (!$(this).length) {
& & & & & & & & & & & & return this;
& & & & & & & & }
& & & & & & & & $(this)
& & & & & & & & & & & & .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {})))
& & & & & & & & & & & & .unbind('click.fb')
& & & & & & & & & & & & .bind('click.fb', function(e) {
& & & & & & & & & & & & & & & & e.preventDefault();
& & & & & & & & & & & & & & & & if (busy) {
& & & & & & & & & & & & & & & & & & & & return;
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & busy = true;
& & & & & & & & & & & & & & & & $(this).blur();
& & & & & & & & & & & & & & & & selectedArray = [];
& & & & & & & & & & & & & & & & selectedIndex = 0;
& & & & & & & & & & & & & & & & var rev = $(this).attr('rev') || '';
& & & & & & & & & & & & & & & & if (!rev || rev == '' || rev === 'nofollow') {
& & & & & & & & & & & & & & & & & & & & selectedArray.push(this);
& & & & & & & & & & & & & & & & } else {
& & & & & & & & & & & & & & & & & & & & selectedArray = $(&a[rev=& + rev + &], area[rev=& + rev + &]&);
& & & & & & & & & & & & & & & & & & & & selectedIndex = selectedArray.index( this );
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & _start();
& & & & & & & & & & & & & & & & return;
& & & & & & & & & & & & });
& & & & & & & & return this;
& & & & };
& & & & $.fancybox = function(obj) {
& & & & & & & & var opts;
& & & & & & & & if (busy) {
& & & & & & & & & & & & return;
& & & & & & & & }
& & & & & & & & busy = true;
& & & & & & & & opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {};
& & & & & & & & selectedArray = [];
& & & & & & & & selectedIndex = parseInt(opts.index, 10) || 0;
& & & & & & & & if ($.isArray(obj)) {
& & & & & & & & & & & & for (var i = 0, j = obj.length; i & j; i++) {
& & & & & & & & & & & & & & & & if (typeof obj[i] == 'object') {
& & & & & & & & & & & & & & & & & & & & $(obj[i]).data('fancybox', $.extend({}, opts, obj[i]));
& & & & & & & & & & & & & & & & } else {
& & & & & & & & & & & & & & & & & & & & obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts));
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & }
& & & & & & & & & & & & selectedArray = jQuery.merge(selectedArray, obj);
& & & & & & & & } else {
& & & & & & & & & & & & if (typeof obj == 'object') {
& & & & & & & & & & & & & & & & $(obj).data('fancybox', $.extend({}, opts, obj));
& & & & & & & & & & & & } else {
& & & & & & & & & & & & & & & & obj = $({}).data('fancybox', $.extend({content : obj}, opts));
& & & & & & & & & & & & }
& & & & & & & & & & & & selectedArray.push(obj);
& & & & & & & & }
& & & & & & & & if (selectedIndex & selectedArray.length || selectedIndex & 0) {
& & & & & & & & & & & & selectedIndex = 0;
& & & & & & & & }
& & & & & & & & _start();
& & & & };
& & & & $.fancybox.showActivity = function() {
& & & & & & & & clearInterval(loadingTimer);
& & & & & & & & loading.show();
& & & & & & & & loadingTimer = setInterval(_animate_loading, 66);
& & & & };
& & & & $.fancybox.hideActivity = function() {
& & & & & & & & loading.hide();
& & & & };
& & & & $.fancybox.next = function() {
& & & & & & & & return $.fancybox.pos( currentIndex + 1);
& & & & };
& & & & $.fancybox.prev = function() {
& & & & & & & & return $.fancybox.pos( currentIndex - 1);
& & & & };
& & & & $.fancybox.pos = function(pos) {
& & & & & & & & if (busy) {
& & & & & & & & & & & & return;
& & & & & & & & }
& & & & & & & & pos = parseInt(pos);
& & & & & & & & selectedArray = currentArray;
& & & & & & & & if (pos & -1 && pos & currentArray.length) {
& & & & & & & & & & & & selectedIndex = pos;
& & & & & & & & & & & & _start();
& & & & & & & & } else if (currentOpts.cyclic && currentArray.length & 1) {
& & & & & & & & & & & & selectedIndex = pos &= currentArray.length ? 0 : currentArray.length - 1;
& & & & & & & & & & & & _start();
& & & & & & & & }
& & & & & & & & return;
& & & & };
& & & & $.fancybox.cancel = function() {
& & & & & & & & if (busy) {
& & & & & & & & & & & & return;
& & & & & & & & }
& & & & & & & & busy = true;
& & & & & & & & $.event.trigger('fancybox-cancel');
& & & & & & & & _abort();
& & & & & & & & selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts);
& & & & & & & & busy = false;
& & & & };
& & & & // Note: within an iframe use - parent.$.fancybox.close();
& & & & $.fancybox.close = function() {
& & & & & & & & if (busy || wrap.is(':hidden')) {
& & & & & & & & & & & & return;
& & & & & & & & }
& & & & & & & & busy = true;
& & & & & & & & if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
& & & & & & & & & & & & busy = false;
& & & & & & & & & & & & return;
& & & & & & & & }
& & & & & & & & _abort();
& & & & & & & & $(close.add( nav_left ).add( nav_right )).hide();
& & & & & & & & $(content.add( overlay )).unbind();
& & & & & & & & $(window).unbind(&resize.fb scroll.fb&);
& & & & & & & & $(document).unbind('keydown.fb');
& & & & & & & & content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank');
& & & & & & & & if (currentOpts.titlePosition !== 'inside') {
& & & & & & & & & & & & title.empty();
& & & & & & & & }
& & & & & & & & wrap.stop();
& & & & & & & & function _cleanup() {
& & & & & & & & & & & & overlay.fadeOut('fast');
& & & & & & & & & & & & title.empty().hide();
& & & & & & & & & & & & wrap.hide();
& & & & & & & & & & & & $.event.trigger('fancybox-cleanup');
& & & & & & & & & & & & content.empty();
& & & & & & & & & & & & currentOpts.onClosed(currentArray, currentIndex, currentOpts);
& & & & & & & & & & & & currentArray = selectedOpts & & = [];
& & & & & & & & & & & & currentIndex = selectedIndex = 0;
& & & & & & & & & & & & currentOpts = selectedOpts& & & = {};
& & & & & & & & & & & & busy = false;
& & & & & & & & }
& & & & & & & & if (currentOpts.transitionOut == 'elastic') {
& & & & & & & & & & & & start_pos = _get_zoom_from();
& & & & & & & & & & & & var pos = wrap.position();
& & & & & & & & & & & & final_pos = {
& & & & & & & & & & & & & & & & top & & &: pos.top ,
& & & & & & & & & & & & & & & & left : pos.left,
& & & & & & & & & & & & & & & & width : wrap.width(),
& & & & & & & & & & & & & & & & height : wrap.height()
& & & & & & & & & & & & };
& & & & & & & & & & & & if (currentOpts.opacity) {
& & & & & & & & & & & & & & & & final_pos.opacity = 1;
& & & & & & & & & & & & }
& & & & & & & & & & & & title.empty().hide();
& & & & & & & & & & & & fx.prop = 1;
& & & & & & & & & & & & $(fx).animate({ prop: 0 }, {
& & & & & & & & & & & & & & & & &duration : currentOpts.speedOut,
& & & & & & & & & & & & & & & & &easing : currentOpts.easingOut,
& & & & & & & & & & & & & & & & &step : _draw,
& & & & & & & & & & & & & & & & &complete : _cleanup
& & & & & & & & & & & & });
& & & & & & & & } else {
& & & & & & & & & & & & wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup);
& & & & & & & & }
& & & & };
& & & & $.fancybox.resize = function() {
& & & & & & & & if (overlay.is(':visible')) {
& & & & & & & & & & & & overlay.css('height', $(document).height());
& & & & & & & & }
& & & & & & & & $.fancybox.center(true);
& & & & };
& & & & $.fancybox.center = function() {
& & & & & & & & var view, align;
& & & & & & & & if (busy) {
& & & & & & & & & & & & return;
& & & & & & & & }
& & & & & & & & align = arguments[0] === true ? 1 : 0;
& & & & & & & & view = _get_viewport();
& & & & & & & & if (!align && (wrap.width() & view[0] || wrap.height() & view[1])) {
& & & & & & & & & & & & return;
& & & & & & & & }
& & & & & & & & wrap
& & & & & & & & & & & & .stop()
& & & & & & & & & & & & .animate({
& & & & & & & & & & & & & & & & 'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)),
& & & & & & & & & & & & & & & & 'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding))
& & & & & & & & & & & & }, typeof arguments[0] == 'number' ? arguments[0] : 200);
& & & & };
& & & & $.fancybox.init = function() {
& & & & & & & & if ($(&#fancybox-wrap&).length) {
& & & & & & & & & & & & return;
& & & & & & & & }
& & & & & & & & $('body').append(
& & & & & & & & & & & & tmp & & = $('&div id=&fancybox-tmp&&&/div&'),
& & & & & & & & & & & & loading = $('&div id=&fancybox-loading&&&div&&/div&&/div&'),
& & & & & & & & & & & & overlay = $('&div id=&fancybox-overlay&&&/div&'),
& & & & & & & & & & & & wrap = $('&div id=&fancybox-wrap&&&/div&')
& & & & & & & & );
& & & & & & & & outer = $('&div id=&fancybox-outer&&&/div&')
& & & & & & & & & & & & .append('&div class=&fancybox-bg& id=&fancybox-bg-n&&&/div&&div class=&fancybox-bg& id=&fancybox-bg-ne&&&/div&&div class=&fancybox-bg& id=&fancybox-bg-e&&&/div&&div class=&fancybox-bg& id=&fancybox-bg-se&&&/div&&div class=&fancybox-bg& id=&fancybox-bg-s&&&/div&&div class=&fancybox-bg& id=&fancybox-bg-sw&&&/div&&div class=&fancybox-bg& id=&fancybox-bg-w&&&/div&&div class=&fancybox-bg& id=&fancybox-bg-nw&&&/div&')
& & & & & & & & & & & & .appendTo( wrap );
& & & & & & & & outer.append(
& & & & & & & & & & & & content = $('&div id=&fancybox-content&&&/div&'),
& & & & & & & & & & & & close = $('&a id=&fancybox-close&&&/a&'),
& & & & & & & & & & & & title = $('&div id=&fancybox-title&&&/div&'),
& & & & & & & & & & & & nav_left = $('&a href=&javascript:;& id=&fancybox-left&&&span class=&fancy-ico& id=&fancybox-left-ico&&&/span&&/a&'),
& & & & & & & & & & & & nav_right = $('&a href=&javascript:;& id=&fancybox-right&&&span class=&fancy-ico& id=&fancybox-right-ico&&&/span&&/a&')
& & & & & & & & );
& & & & & & & & close.click($.fancybox.close);
& & & & & & & & loading.click($.fancybox.cancel);
& & & & & & & & nav_left.click(function(e) {
& & & & & & & & & & & & e.preventDefault();
& & & & & & & & & & & & $.fancybox.prev();
& & & & & & & & });
& & & & & & & & nav_right.click(function(e) {
& & & & & & & & & & & & e.preventDefault();
& & & & & & & & & & & & $.fancybox.next();
& & & & & & & & });
& & & & & & & & if ($.fn.mousewheel) {
& & & & & & & & & & & & wrap.bind('mousewheel.fb', function(e, delta) {
& & & & & & & & & & & & & & & & if (busy) {
& & & & & & & & & & & & & & & & & & & & e.preventDefault();
& & & & & & & & & & & & & & & & } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) {
& & & & & & & & & & & & & & & & & & & & e.preventDefault();
& & & & & & & & & & & & & & & & & & & & $.fancybox[ delta & 0 ? 'prev' : 'next']();
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & });
& & & & & & & & }
& & & & & & & & if (!$.support.opacity) {
& & & & & & & & & & & & wrap.addClass('fancybox-ie');
& & & & & & & & }
& & & & & & & & if (isIE6) {
& & & & & & & & & & & & loading.addClass('fancybox-ie6');
& & & & & & & & & & & & wrap.addClass('fancybox-ie6');
& & & & & & & & & & & & $('&iframe id=&fancybox-hide-sel-frame& src=&' + (/^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank' ) + '& scrolling=&no& border=&0& frameborder=&0& tabindex=&-1&&&/iframe&').prependTo(outer);
& & & & & & & & }
& & & & };
& & & & $.fn.fancybox.defaults = {
& & & & & & & & padding : 10,
& & & & & & & & margin : 40,
& & & & & & & & opacity : false,
& & & & & & & & modal : false,
& & & & & & & & cyclic : false,
& & & & & & & & scrolling : 'auto', & & // 'auto', 'yes' or 'no'
& & & & & & & & width : 560,
& & & & & & & & height : 340,
& & & & & & & & autoScale : true,
& & & & & & & & autoDimensions : true,
& & & & & & & & centerOnScroll : false,
& & & & & & & & ajax : {},
& & & & & & & & swf : { wmode: 'transparent' },
& & & & & & & & hideOnOverlayClick : true,
& & & & & & & & hideOnContentClick : false,
& & & & & & & & overlayShow : true,
& & & & & & & & overlayOpacity : 0.7,
& & & & & & & & overlayColor : '#777',
& & & & & & & & titleShow : true,
& & & & & & & & titlePosition : 'float', // 'float', 'outside', 'inside' or 'over'
& & & & & & & & titleFormat : null,
& & & & & & & & titleFromAlt : false,
& & & & & & & & transitionIn : 'fade', // 'elastic', 'fade' or 'none'
& & & & & & & & transitionOut : 'fade', // 'elastic', 'fade' or 'none'
& & & & & & & & speedIn : 300,
& & & & & & & & speedOut : 300,
& & & & & & & & changeSpeed : 300,
& & & & & & & & changeFade : 'fast',
& & & & & & & & easingIn : 'swing',
& & & & & & & & easingOut : 'swing',
& & & & & & & & showCloseButton &: true,
& & & & & & & & showNavArrows : true,
& & & & & & & & enableEscapeButton : true,
& & & & & & & & enableKeyboardNav : true,
& & & & & & & & onStart : function(){},
& & & & & & & & onCancel : function(){},
& & & & & & & & onComplete : function(){},
& & & & & & & & onCleanup : function(){},
& & & & & & & & onClosed : function(){},
& & & & & & & & onError : function(){}
& & & & };
& & & & $(document).ready(function() {
& & & & & & & & $.fancybox.init();
& & & & });
})(jQuery);
- 下载整个
相关源码/软件:
- 旋转的立方体,纯JavaScript编写,组成Google图案,旋转的速度由你操作鼠标的速度决定,时...
- jQuery无刷新实时修改网页Input的内容,可以把input数据在不经过数据读取的情况下及时修改...
- 又一个jQuery焦点图切换,带文字标题等介绍,而且还有动画效果噢,这款滚动式的幻灯片设计的也挺漂亮...
- 仿QQ游戏频道的图片推荐特效代码,基于jQuery的代码实现,超个性的切换效果,不知如何给大家描述,...
- imgToggle 两套基于jQuery的图片切换,不同代码风格实现的,一款是基于jQuery的,另...
- jQuery 仿iPhone手机用户登录,可即时显示用户当前正在输入的密码,过1秒左右隐藏成符号,输...
- pyramid使用jQuery动态添加DIV,实现金字塔结构,虽然功能单一,不过方法实用,前端开发时...
- jQuery幻灯片,图像淡入淡出切换,用单击鼠标可控制图像集播放,前一张图片与后一张交叉淡入淡出。最...
- HTML+jQuery 实现单文件静态留言功能,同时还采用了数据库,在JS中调用类连接和操作数据库,...
- js写的网页上的滑块模块,引入了jQuery框架,在兼容性方面做的挺不错,用鼠标控制模块,可以实现网...
- asp微信公众号接口开发在线调试工具V1.0
开发者必备,有了他,你可以随时随地进行微信公众号接口...
- 双人对战五子棋源码自适应分辨率,方便没有棋盘的时候跟朋友消遣。
- 3D竞速游戏极速飞行介绍:
玩法:点击开始可以进入飞船选择界面,点击左右箭头可以选择飞船,手指上下...
- 仿微信的飞机大战游戏源码介绍:
本源码所有图片或者音效素材都是取自微信的飞机大战,纯java实现,...
- Q版疯狂大炮游戏源码介绍:
疯狂大炮是一款射击类的益智游戏源码,玩家需要控制大炮炮弹的力度与角度来...
- 打豆豆游戏源码简介:
源码实现了一款支持平板的打豆豆游戏,游戏的玩法是判断这个点是否是空白,如果是...
- android水果连连看源码简介:
游戏带有背景音乐、音效,玩法与大多数此类游戏一样,玩法依旧是消...
- 贪吃蛇游戏-安卓程序源码实例下载,学习Android最快的方法就是先研究例子,非常经典的安卓源码例子...
- 3D迷宫安卓游戏源码是一款3D效果的迷宫游戏,设有键盘和虚拟键盘两种模式。
- 俄罗斯方块源码简介:
俄罗斯方块源码里面有三个模块,一个简单版,一个复杂版,还有一个扫雷。复杂版的...}

我要回帖

更多关于 弹出div窗口 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信