这里有jquery影像回放路径插件称为Fancybox,项目主页地址:http://fancybox.net/

Fancybox的特点例如以下:

1、能够支持图片、html文本、flash动画、iframe以及ajax的支持

2、能够自己定义播放器的CSS样式

3、能够以组的形式进行播放,导航的button(上一项,下一项)

4、假设将鼠标滚动插件(mouse wheel plugin)包括进来的话Fancybox还能支持鼠标滚轮滚动来翻阅图片

5、Fancybox播放器支持投影。更有立体的感觉

Fancybox用法:

1、引入jquery核心库和Fancybox插件库

<script type="text/javascript" src="/js/jquery-1.8.0.js"></script>
<script type="text/javascript" src="/fancybox/jquery.fancybox-1.3.4.pack.js"></script>

可选-假设须要用到fancy transition(一些动画效果)你还须要引入下面脚本

<script type="text/javascript" src="/fancybox/jquery.easing-1.4.pack.js"></script>

可选-假设须要支持鼠标滚轮滚动效果你还须要引入下面脚本

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

2、加入样式文件

<link rel="stylesheet" href="/fancybox/jquery.fancybox-1.3.4.css" type="text/css" media="screen">

3、在页面上创建链接元素

A、图片元素

<a id="simple_1" href="/img/simple1.jpg"><img src="/img/simple1.jpg" alt=""/></a>

B、普通文本

<a id="simple_2" href="#data" kesrc="#data">点击这里将显示文本</a>
<div style="display: none;">
<div id="data">那片笑声让我想起我的那些花儿,在我生命每一个角落静静为我开着.</div>
</div>

C、Iframe

<a id="simple_3" href="http://www.baidu.com">Baidu</a>

D、不同的动画风格

<a id="example1" href="/img/simple1.jpg"><img alt="example1" src="/img/simple1.jpg" /></a>
<a id="example2" href="/img/simple1.jpg"><img alt="example2" src="/img/simple1.jpg" /></a>
<a id="example3" href="/img/simple1.jpg"><img alt="example3" src="/img/simple1.jpg" /></a>
<a id="example4" href="/img/simple1.jpg"><img class="last" alt="example4" src="/img/simple1.jpg" /></a>

E、不同的标题位置

<a id="example5" href="/img/simple1.jpg" title="Learn a little bit every day."><img alt="example4" src="/img/simple1.jpg" /></a>
<a id="example6" href="/img/simple1.jpg" title="Learn a little bit every day."><img alt="example5" src="/img/simple1.jpg" /></a>
<a id="example7" href="/img/simple1.jpg" title="Learn a little bit every day."><img alt="example6" src="/img/simple1.jpg" /></a>
<a id="example8" href="/img/simple1.jpg" title="Learn a little bit every day."><img class="last" alt="example7" src="/img/simple1.jpg" /></a>

F、以组的形式进行播放

<a rel="example_group" href="/img/simple1.jpg"><img alt="" src="/img/simple1.jpg" /></a>
<a rel="example_group" href="/img/simple2.jpg"><img alt="" src="/img/simple2.jpg" /></a>

4、jquery实现效果

<script type="text/javascript">
$(function(){
$("a#simple_1").fancybox(); //图片元素
$("a#simple_2").fancybox(); //普通文本
$("#simple_3").fancybox({ //iframe元素
'width' : '75%',
'height' : '75%',
'autoScale' : false,
'transitionIn' : 'none',
'transitionOut' : 'none',
'type' : 'iframe'
}); //不同的动画风格
$("a#example1").fancybox(); $("a#example2").fancybox({
'overlayShow' : false,
'transitionIn' : 'elastic',
'transitionOut' : 'elastic'
}); $("a#example3").fancybox({
'transitionIn' : 'none',
'transitionOut' : 'none'
}); $("a#example4").fancybox({
'opacity' : true,
'overlayShow' : false,
'transitionIn' : 'elastic',
'transitionOut' : 'none'
}); //不同的标题位置
$("a#example5").fancybox(); $("a#example6").fancybox({
'titlePosition' : 'outside',
'overlayColor' : '#000',
'overlayOpacity' : 0.9
}); $("a#example7").fancybox({
'titlePosition' : 'inside'
}); $("a#example8").fancybox({
'titlePosition' : 'over'
}); //以组的形式进行播放
$("a[rel=example_group]").fancybox({
'transitionIn' : 'none',
'transitionOut' : 'none',
'titlePosition' : 'over',
'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / '
+ currentArray.length + (title.length ? '   ' + title : '') + '</span>';
}
}); })
</script>

版权声明:本文博主原创文章,博客,未经同意不得转载。

jQuery Fancybox插件说明的更多相关文章

  1. jQuery Fancybox插件介绍

    下面介绍一款jquery图片播放插件叫Fancybox,项目主页地址:http://fancybox.net/ Fancybox的特点如下: 1.可以支持图片.html文本.flash动画.ifram ...

  2. jQuery Fancybox插件使用参数详解

    Fancybox的特点如下: 可以支持图片.html文本.flash动画.iframe以及ajax的支持 可以自定义播放器的CSS样式 可以以组的形式进行播放 如果将鼠标滚动插件(mouse whee ...

  3. FancyBox - 经典的 jQuery Lightbox 插件

    FancyBox 是一款非常优秀的弹窗插件,能够为图片.HTML 内容和其它任务的多媒体内容提供优雅的弹出缩放效果.作为是最流行的 Lightbox 插件之一,可以通过 fitToView 实现自适应 ...

  4. 精选29款非常实用的jQuery应用插件

    今天我们来分享一些实用的jQuery应用插件,没有特别花哨,但都比较实用,jQuery菜单.jQuery图片都有涉及到,一起来看看. 1.jQuery+CSS3仿IOS无线局域网Wifi DEMO演示 ...

  5. 14款让前端开发者心动的jQuery/CSS3插件及源码

    14款让前端开发者心动的jQuery/CSS3插件及源码,一起来看看. 1.jQuery左右滚动banner代码! DEMO演示    /    源码下载 2.jQuery QQ表情插件qqFace ...

  6. [转]jquery Fancybox丰富的弹出层效果

    本文转自:http://www.helloweba.com/view-blog-65.html Fancybox是一款优秀的jquery插件,它能够展示丰富的弹出层效果.前面我们有文章介绍了facyb ...

  7. jquery Fancybox使用教程

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

  8. 30个Jquery灯箱插件

    jQuery 是非常流行的JS框架,其俨然已成了开发者的必备工具,其中的jQuery Lightbox插件更是为广大开发者所喜爱.它惊人的特征之一是jQuery Lightbox插件有很多变化. 下面 ...

  9. 深入学习jQuery自定义插件

    原文地址:jQuery自定义插件学习 1.定义插件的方法 对象级别的插件扩展,即为jQuery类的实例增加方法, 调用:$(选择器).函数名(参数);      $(‘#id’).myPlugin(o ...

随机推荐

  1. CImageList类Create函数参数解析

    前面提到了CImageList类的Create(...)函数,虽然MSDN上已经有所解释,但仍有网友问到参数的具体含义,下面就我的理解,对参数进行一次轻量级的剖析 函数原型(其他重载函数请参看msdn ...

  2. [置顶] MyEclipse显示中文界面,在线安装教程

    准备工作 1,装好MyEclipse软件 2,可以上网 3,在线安装地址:http://download.eclipse.org/technology/babel/update-site/R0.11. ...

  3. Python string replace 方法

    Python string replace   方法 方法1: >>> a='...fuck...the....world............' >>> b=a ...

  4. TControlStyle.csParentBackground的作用(附Delphi里的所有例子,待续)

    Only applicable when Themes are enabled in applications on Windows XP. Causes the parent to draw its ...

  5. 将单词首字母大写的JS脚本工具

    <html> <head> <title>首字母全改为大写JS脚</title> <SCRIPT LANGUAGE="JavaScrip ...

  6. 10881 - Piotr's Ants

    Problem D Piotr's Ants Time Limit: 2 seconds "One thing is for certain: there is no stopping th ...

  7. Delphi使用StrToDatetime在不同操作系统出现不同的情况(控制面板的时间格式都记录在注册表里,因此也可修改注册表)

    Str:=  '2010-4-13  06:22:22'; StrToDateTime(Str); 现象:在WinXP, Win2003 都不会报错 但是在Windows7,Windows Serve ...

  8. thinkphp模版调用函数方法

    原文:thinkphp模版调用函数方法 {变量|函数1|函数2|函数3=参数1,参数2,参数3,###} ###为第4个参数,代表变量替换为第4个参数 举例: {$username|substr=0, ...

  9. 硬盘重装Ubuntu12.04的感受

    好久没更blog了,最近这两天系统也出了问题,win7蓝屏,ubuntu进不去-.后来win7整好了,ubuntu依旧顽固.用惯了linux,就不想在转到win7下面了,估计是习惯了各种敲命令的感觉吧 ...

  10. 24位和8位BMP图片保存纯C代码

    BMP图片大家都知道,可以通过查看BMP图片结构使用纯C就可以打开,编辑,处理,保存图片.非常方便使用. 具体BMP结构可以参考:wingdi.h头文件.今天主要在进行删减代码,需要把多余的代码删除, ...