fancyBox
========
fancyBox is a tool that offers a nice and elegant way to add zooming functionality for images, html content and multi-media on your webpages.
More information and examples: http://www.fancyapps.com/fancybox/
License: http://www.fancyapps.com/fancybox/#license
Copyright (c) 2012 Janis Skarnelis - janis@fancyapps.com
How to use
----------
To get started, download the plugin, unzip it and copy files to your website/application directory.
Load files in the <head> section of your HTML document. Make sure you also add the jQuery library.
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css" type="text/css" media="screen" />
<script type="text/javascript" src="/fancybox/jquery.fancybox.pack.js"></script>
</head>
Create your links with a `title` if you want a title to be shown, and add a class:
<a href="large_image.jpg" class="fancybox" title="Sample title"><img src="small_image.jpg" /></a>
If you have a set of related items that you would like to group,
additionally include a group name in the `rel` (or `data-fancybox-group`) attribute:
<a href="large_1.jpg" class="fancybox" rel="gallery" title="Sample title 1"><img src="small_1.jpg" /></a>
<a href="large_2.jpg" class="fancybox" rel="gallery" title="Sample title 1"><img src="small_2.jpg" /></a>
Initialise the script like this:
<script>
$(document).ready(function() {
$('.fancybox').fancybox();
});
</script>
May also be passed an optional options object which will extend the default values. Example:
<script>
$(document).ready(function() {
$('.fancybox').fancybox({
padding : 0,
openEffect : 'elastic'
});
});
</script>
Tip: Automatically group and apply fancyBox to all images:
$("a[href$='.jpg'],a[href$='.jpeg'],a[href$='.png'],a[href$='.gif']").attr('rel', 'gallery').fancybox();
Script uses the `href` attribute of the matched elements to obtain the location of the content and to figure out content type you want to display.
You can specify type directly by adding classname (fancybox.image, fancybox.iframe, etc) or `data-fancybox-type` attribute:
//Ajax:
<a href="/example.html" class="fancybox fancybox.ajax">Example</a>
//or
<a href="/example.html" class="fancybox" data-fancybox-type="ajax">Example</a>
//Iframe:
<a href="example.html" class="fancybox fancybox.iframe">Example</a>
//Inline (will display an element with `id="example"`)
<a href="#example" class="fancybox">Example</a>
//SWF:
<a href="example.swf" class="fancybox">Example</a>
//Image:
<a href="example.jpg" class="fancybox">Example</a>
Note, ajax requests are subject to the [same origin policy](http://en.wikipedia.org/wiki/Same_origin_policy).
If fancyBox will not be able to get content type, it will try to guess based on 'href' and will quit silently if would not succeed.
(this is different from previsous versions where 'ajax' was used as default type or an error message was displayed).
Advanced
--------
### Helpers
Helpers provide a simple mechanism to extend the capabilities of fancyBox. There are two built-in helpers - 'overlay' and 'title'.
You can disable them, set custom options or enable other helpers. Examples:
//Disable title helper
$(".fancybox").fancybox({
helpers: {
title: null
}
});
//Disable overlay helper
$(".fancybox").fancybox({
helpers: {
overlay : null
}
});
//Change title position and overlay color
$(".fancybox").fancybox({
helpers: {
title : {
type : 'inside'
},
overlay : {
css : {
'background' : 'rgba(255,255,255,0.5)'
}
}
}
});
//Enable thumbnail helper and set custom options
$(".fancybox").fancybox({
helpers: {
thumbs : {
width: 50,
height: 50
}
}
});
### API
Also available are event driven callback methods. The `this` keyword refers to the current or upcoming object (depends on callback method). Here is how you can change title:
$(".fancybox").fancybox({
beforeLoad : function() {
this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
/*
"this.element" refers to current element, so you can, for example, use the "alt" attribute of the image to store the title:
this.title = $(this.element).find('img').attr('alt');
*/
}
});
It`s possible to open fancyBox programmatically in various ways:
//HTML content:
$.fancybox( '<div><h1>Lorem Lipsum</h1><p>Lorem lipsum</p></div>', {
title : 'Custom Title'
});
//DOM element:
$.fancybox( $("#inline"), {
title : 'Custom Title'
});
//Custom object:
$.fancybox({
href: 'example.jpg',
title : 'Custom Title'
});
//Array of objects:
$.fancybox([
{
href: 'example1.jpg',
title : 'Custom Title 1'
},
{
href: 'example2.jpg',
title : 'Custom Title 2'
}
], {
padding: 0
});
There are several methods that allow you to interact with and manipulate fancyBox, example:
//Close fancybox:
$.fancybox.close();
There is a simply way to access wrapping elements using JS:
$.fancybox.wrap
$.fancybox.skin
$.fancybox.outer
$.fancybox.inner
You can override CSS to customize the look. For example, make navigation arrows always visible,
change width and move them outside of area (use this snippet after including fancybox.css):
.fancybox-nav span {
visibility: visible;
}
.fancybox-nav {
width: 80px;
}
.fancybox-prev {
left: -80px;
}
.fancybox-next {
right: -80px;
}
In that case, you might want to increase space around box:
$(".fancybox").fancybox({
margin : [20, 60, 20, 60]
});
Bug tracker
-----------
Have a bug? Please create an issue on GitHub at https://github.com/fancyapps/fancyBox/issues
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【项目资源】:包含前端、后端、移动开发、操作系统、人工智能、物联网、信息化管理、数据库、硬件开发、大数据、课程资源、音视频、网站开发等各种技术项目的源码。包括STM32、ESP8266、PHP、QT、Linux、iOS、C++、Java、python、web、C#、EDA、proteus、RTOS等项目的源码。【项目质量】:所有源码都经过严格测试,可以直接运行。功能在确认正常工作后才上传。【适用人群】:适用于希望学习不同技术领域的小白或进阶学习者。可作为毕设项目、课程设计、大作业、工程实训或初期项目立项。【附加价值】:项目具有较高的学习借鉴价值,也可直接拿来修改复刻。对于有一定基础或热衷于研究的人来说,可以在这些基础代码上进行修改和扩展,实现其他功能。【沟通交流】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。鼓励下载和使用,并欢迎大家互相学习,共同进步。
资源推荐
资源详情
资源评论
收起资源包目录
基于HTML实现的FLAT商务宽屏响应式css3动画Bootstrap(含HTML源代码+使用说明).zip (241个子文件)
bootstrap.css 117KB
bootstrap.min.css 95KB
font-awesome-ie7.css 40KB
font-awesome-ie7.min.css 37KB
style.css 35KB
font-awesome.css 27KB
settings (In Konflikt stehende Kopie von Flash Horvath 2013-02-13).css 24KB
settings.css 24KB
font-awesome.min.css 22KB
bootstrap-theme.css 16KB
bootstrap-theme.min.css 15KB
preview.css 9KB
jquery.bxslider.css 6KB
bootstrap-reset.css 5KB
jquery.fancybox.css 4KB
flexslider.css 4KB
style-responsive.css 3KB
jquery.fancybox-buttons.css 2KB
rs-style.css 2KB
superfish.css 2KB
jquery.fancybox-thumbs.css 717B
superfish-vertical.css 583B
theme.css 199B
.DS_Store 15KB
.DS_Store 12KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
fontawesome-webfont.eot 37KB
glyphicons-halflings-regular.eot 14KB
bx_loader.gif 8KB
fancybox_loading.gif 4KB
loader2.gif 3KB
loader.gif 2KB
blank.gif 43B
.gitattributes 174B
index.html 35KB
index-static.html 29KB
index.html 29KB
services.html 27KB
blog.html 26KB
button.html 21KB
blog_detail.html 21KB
typography.html 20KB
about.html 19KB
portfolio.html 16KB
index-fullwidth.html 13KB
price.html 10KB
index.html 9KB
contact.html 9KB
iframe.html 2KB
red-bg.jpg 263KB
img4.jpg 150KB
flat_parallax.jpg 141KB
about_1.jpg 140KB
img1.jpg 132KB
img2.jpg 128KB
img3.jpg 124KB
img7.jpg 114KB
about_2.jpg 106KB
img5.jpg 99KB
4_b.jpg 82KB
1_b.jpg 80KB
img6.jpg 75KB
5_b.jpg 74KB
3_b.jpg 54KB
2_b.jpg 50KB
banner_bg.jpg 41KB
img4.jpg 37KB
team_img3.jpg 37KB
team_img2.jpg 34KB
team_img1.jpg 33KB
img2.jpg 20KB
img1.jpg 18KB
img3.jpg 15KB
avatar2.jpg 14KB
product1.jpg 12KB
avatar1.jpg 10KB
testimonial-img-1.jpg 10KB
blog-thumb-1.jpg 9KB
1_s.jpg 8KB
blog-thumb-3.jpg 6KB
4_s.jpg 5KB
divider.jpg 5KB
5_s.jpg 4KB
blog-thumb-2.jpg 4KB
3_s.jpg 2KB
bgtile.jpg 2KB
2_s.jpg 1KB
search-icon.jpg 548B
transparent.jpg 287B
jquery-ui-1.9.2.custom.min.js 232KB
jquery.themepunch.revolution.js 115KB
jquery-1.8.3.min.js 91KB
jquery-1.8.2.min.js 91KB
共 241 条
- 1
- 2
- 3
资源评论
CrMylive.
- 粉丝: 1w+
- 资源: 4万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- IPMSM永磁电机弱磁控制 附有说明文档 公式法MTPA 采用电压反馈弱磁 波形很好 跟踪很稳 包含仿真文件和两个详细说明文档 简单易懂
- MySQL学生成绩管理系统
- 面向目标探测与跟踪的相控阵雷达波束调度策略研究 开题报告答辩.pptx
- 考虑风光火储和电动汽车的微电网经济调度 软件:Matlab+cplex工具箱 介绍:在Matlab 平台上以一个包含风、光、柴油发电机、上级电网、储能以及电动汽车的小型微电网系统为例进行仿真 目标包
- springboot校园在线拍卖系统
- 广东墨睿科技有限公司创投信息
- STM32L0xx官方开发包
- 故障诊断分类 matlab代码 轴承内圈、外圈、滚动体故障分类 (1)故障样本的时域、频域、时频域、熵等特征提取; (2)BP网络或者SVM模型训练与测试 (3)输出测试样本分类准确率 成套代码,注释
- 冲床送料机程序 中达优控一体机编写 此程序已经实际设备上批量应用,程序成熟可靠,借鉴价值高,程序有注释
- tensorflow用户实验报告
- 杭州华卓信息科技有限公司创投信息
- 含电池储能+pid控制器的两区域互联网电网调频仿真
- 毕业设计B058-基于Java的卓越导师双选系统的设计与实现
- 杭州孝道科技有限公司创投信息
- 儿童节烟花代码2python实现
- 大厂成熟FOC直流电机控制方案,此方案可用于电动自行车,滑板车等电机驱动 单片机基于Stm031或相应兆易GD32等单片机 转把,高中低三速 刹车功能 助力功能 电子刹车功能 欠压检测 巡航
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功