jquery Fancybox使用教程

jquery Fancybox使用教程

Fancybox是一款基于jquery的对图片展示播放的插件,当然,它html文本、flash动画、iframe以及ajax也予以支持。还可以通过css自定义外观,阴影效果超级赞!

演示效果:http://www.phpddt.com/demo/fancyBox/demo/index.html
使用教程也是相当简单:

首先当然是要引入jquery核心库和Fancybox插件库:

<script type="text/javascript" src="../lib/jquery-1.10.1.min.js"></script>

如果你要实现图片滚轮效果,引入下面文件:

<script type="text/javascript" src="../lib/jquery.mousewheel-3.0.6.pack.js"></script>

FancyBox核心js和css文件:

<script type="text/javascript" src="../source/jquery.fancybox.js?v=2.1.5"></script>

<link rel="stylesheet" type="text/css" href="../source/jquery.fancybox.css?v=2.1.5" media="screen" />

如果你需要按钮效果,引入按钮css文件:

<link rel="stylesheet" type="text/css" href="../source/helpers/jquery.fancybox-buttons.css?v=1.0.5" />

<script type="text/javascript" src="../source/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script>

如果你要实现缩略图效果,引入:

<link rel="stylesheet" type="text/css" href="../source/helpers/jquery.fancybox-thumbs.css?v=1.0.7" />

<script type="text/javascript" src="../source/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>

如果要动态加载媒体,引入:

<script type="text/javascript" src="../source/helpers/jquery.fancybox-media.js?v=1.0.6"></script>

 下面是一个最简单的图片展示例子:

<!DOCTYPE html>
<html>
<head><title>fancyBox使用教程 -  PHP点点通(www.phpddt.com)</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><script type="text/javascript" src="../lib/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="../source/jquery.fancybox.js?v=2.1.5"></script>
<link rel="stylesheet" type="text/css" href="../source/jquery.fancybox.css?v=2.1.5" media="screen" /><script type="text/javascript">$(document).ready(function() {$('.fancybox').fancybox();$(".fancybox-effects-a").fancybox({helpers: {title : {type : 'outside'},overlay : {speedOut : 0}}});});</script><style type="text/css">.fancybox-custom .fancybox-skin {box-shadow: 0 0 50px #222;}body {max-width: 700px;margin: 0 auto;}</style>
</head>
<body><h3>对简单图片展示</h3><p><a class="fancybox" href="1_b.jpg" data-fancybox-group="gallery" title="Lorem ipsum dolor sit amet"><img src="1_s.jpg" /></a></p>
</body>
</html>

 

效果如如下:

jquery Fancybox演示教程

更多FancyBox参数及选项配置如下:

FancyBox参数及选项配置

下载:fancyBox-master.zip  (点击这里演示)

posted on 2013-06-29 21:50 mckee1990 阅读(...) 评论(...) 编辑 收藏

转载于:https://www.cnblogs.com/phpddt/p/3162871.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/274172.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

优衣库不雅_Uniqlo主页-用户体验案例研究

优衣库不雅I am a big fan of Uniqlo because they sell innovative clothing that is great quality at great prices. So when all their stores closed during the “Covid-19 Circuit Breaker” in Singapore, I turned to their website and was surprised how difficult …

shields 徽标_到处都有平面徽标

shields 徽标重点 (Top highlight)Companies invest a lot of time, money and energy trying to make audiences remember their logos and associate higher value with it. The end goal is to make customers pick their brand over another brand. 公司投入了大量的时间&a…

登录,注册,登录,登录..?

Last year I found myself in an interesting conversation about which copy to use for a website’s sign up journey. And it wasn’t the first time. Often this devolves into an opinion-based discussion among stakeholders of the ‘what-I-like-based-on-no-eviden…

未完成的控件

using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms;namespace ImageControls {/// <summary>/// 控件/// </summary> public class ShapeEx : Control{#region 字段private Color _B…

ux设计_UX设计101:

ux设计这是什么&#xff1f; (What is this?) This session is part of a learning curriculum that I designed to incrementally skill up and empower a team of Designers and Researchers whose skillset and ways of working needed to evolve to keep up with changes …

idea重要插件代码颜色_颜色在您的网站上的重要性和品牌形象

idea重要插件代码颜色Choosing the right colors for a website or a logo can be a perplexing and time-consuming task, unless you have the right knowledge of colors. Colors play a pivotal role in the success of some businesses and can make a huge impact on the…

【自己给自己题目做】之一:椭圆可点击区域

【题一】请实现以下需求&#xff0c;要做一个活动页面&#xff0c;页面上有一张图片&#xff08;假设是800x600&#xff09;&#xff0c;图片正中心有一个椭圆形的可点击区域&#xff0c;假设椭圆长轴为200px&#xff08;横向&#xff09;&#xff0c;短轴160px&#xff08;纵向…

信息保真度准则_设计保真度的新的非科学公式

信息保真度准则As designers, our audience is more than just our users. We keep our user’s needs top of mind while designing for their jobs-to-be-done, but sometimes we need to illustrate the problem and articulate solutions to a broader audience: our cross…

zend studio配置调试(Xdebug方式)

1.下载xdebug http://xdebug.org/download.php 我下的是PHP 5.4 VC9 (32 bit) 【当前系统php是php5.4.14(win32)版本】 2.配置php.ini 在文件最后配置 [Xdebug]zend_extension "C:/php5.4.14/ext/php_xdebug-2.2.3-5.4-vc9.dll" xdebug.auto_trace1xdebug.collect_p…

人物肖像速写_肖像学的基础

人物肖像速写More in the iconography series:• 7 Principles of Icon Design• 5 Ways to Create a Settings Icon• Icon Grids & Keylines Demystified• Pixel-Snapping in Icon Design• 3 Classic Icon FamiliesAn icon is a compact symbol that represents a disc…

产品设计的Kawaiization

重点 (Top highlight)在过去的一两年中&#xff0c;我注意到品牌和产品设计中出现了某种风格。 (Over the last year or two, I’ve noticed a certain style emerge in brand and product design.) (this article originally appeared on DESK magazine)(本文最初出现在DESK杂…

陌生人社会_陌生人之旅

陌生人社会The Last of Us Part II is a game that is deeply invested in the minutiae of its characters. The pain they cause, the things that drive them, and the particularities of their self-destruction and salvation. The game’s commitment to the true natur…

java数据类型及其说明

Java数据类型及其说明java基本数据类型&#xff1a; java数据类型分为基本数据类型和引用数据类型&#xff0c;基本数据类型就是4类8种&#xff0c;分为数值类型&#xff08;整数型[byte&#xff0c;short&#xff0c;int&#xff0c;long]&#xff09;&#xff0c;字符型&…

根据图片获得配色方案_配色系列(1)—从图片中获得配色灵感

根据图片获得配色方案前言 (Foreword) When we start designing mobile web pages, we always need to determine the color scheme of the web page first. Well, at this time, unless the customer proposes a color scheme, most of the situations we have to face is to …

七大查找算法

1. 顺序查找2. 二分查找3. 插值查找4. 斐波那契查找5. 树表查找6. 分块查找7. 哈希查找 查找是在大量的信息中寻找一个特定的信息元素&#xff0c;在计算机应用中&#xff0c;查找是常用的基本运算&#xff0c;例如编译程序中符号表的查找。本文简单概括性的介绍了常见的七种查…

HA2795Billboard 可用线段树

#include<iostream>using namespace std;#include<cstdio>#include<algorithm>#define maxn 200005int h,n,w;int root[maxn<<4];int ans;//标记void make_tree(int l,int r,int rt){if(lr){root[rt]w;return ;}int mid(rl)/2;make_tree(l,mid,rt*2);m…

axure下拉列表框单选框_如何在Axure中创建下拉菜单和组合框

axure下拉列表框单选框First, let’s clarify what exactly is a dropdown menu, and what is a combo box, aren’t they the same? Well … no, not really, let me explain.首先&#xff0c;让我们弄清楚什么是下拉菜单&#xff0c;什么是组合框&#xff0c;不是吗&#xf…

Android 第一课 Activity

以下说明基于Android Studio&#xff0c;简称AS。&#xff08;红色字体为自行添加&#xff0c;注在醒目&#xff09; 具体包括&#xff1a;创建活动创建项目 加载布局 在AndroidManifest文件中注册 活动中使用&#xff08;提醒&#xff09;Toast 在活动使用&#xff08;菜…

figma设计_一种在Figma中跟踪设计迭代的简单方法

figma设计As designers, telling a good story is always part of the job. A great story engages the client with the journey of decision making; it shows your team the breadth and depth of the exploration; it also encourages us to reflect on our own design pro…

latex 插图 上下放_专辑插图中上下文中的文本

latex 插图 上下放Especially if, like me, you’re not properly educated in the world of visual design, typography, and all those other things that a formal education can bring. We’re kind of playing around until something fits right, and doesn’t feel jarr…