日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

又一个绝对棒的对话框插件fancybox v1.3.4

發(fā)布時間:2025/3/15 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 又一个绝对棒的对话框插件fancybox v1.3.4 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

http://www.jsfoot.com/jquery/demo/2011-07-30/fancybox/index.html

?

jquery插件:fancybox

Fancybox的特點如下:

  • 可以支持圖片、html文本、flash動畫、iframe以及ajax的支持
  • 可以自定義播放器的CSS樣式
  • 可以以組的形式進行播放
  • 如果將鼠標(biāo)滾動插件(mouse wheel plugin)包含進來的話Fancybox還能支持鼠標(biāo)滾輪滾動來翻閱圖片
  • Fancybox播放器支持投影,更有立體的感覺
  • 使用方法:

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

    ?

    1 2 <script?type="text/javascript"?src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script?type="text/javascript"?src="/fancybox/jquery.fancybox-1.3.4.pack.js"></script>

    可選?- 如果需要用到fancy transition(一些動畫效果)你還需要引入以下腳本

    ?

    ?

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

    可選?- 如果需要支持鼠標(biāo)滾輪滾動效果你還需要引入以下腳本

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

    ?

    2、添加樣式表文件

    ?

    ?

    1 <link?rel="stylesheet"?href="/fancybox/jquery.fancybox-1.3.4.css"?type="text/css"?media="screen"?/>
    以下是一個實現(xiàn)小圖縮放效果的例子: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta http-equiv="imagetoolbar" content="no"/>
    <title>FancyBox 1.3.1 | Demonstration</title>
    <script type="text/javascript" src="js/jquery-1.4.min.js"></script> <!--調(diào)用jquery核心庫----->
    <script type="text/javascript" src="js/jquery.mousewheel-3.0.2.pack.js"></script><!--調(diào)用可用鼠標(biāo)控制的庫-->
    <script type="text/javascript" src="js/jquery.fancybox-1.3.1.js"></script>
    <script type="text/javascript" src="js/pngobject.js"></script> <!--correctly handle PNG transparency in Win IE 5.5 & 6.-->
    <link rel="stylesheet" href="style/style.css" type="text/css"/>
    <link rel="stylesheet" href="style/jquery.fancybox-1.3.1.css" type="text/css"/>


    ?

    <script type="text/javascript">
    $(document).ready(function() {
    /**
    運行的代碼
    */

    $("a[rel=example_group]").fancybox({
    'transitionIn' : 'fade', //設(shè)置動畫效果. 可以設(shè)置為 'elastic', 'fade' 或 'none'
    'transitionOut' : 'fade', //同上
    'titlePosition' : 'over', //設(shè)置標(biāo)題顯示的位置.可以設(shè)置成 'outside', 'inside' 或 'over'
    'titleFormat' : function(title, currentArray, currentIndex, currentOpts) { //可以自定義標(biāo)題的格式
    return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
    }
    });

    <!-------------------------------------以下屬于測試代碼,不在此例子效果實現(xiàn)的代碼內(nèi)------------------------------------>
    /*
    * 單獨設(shè)置每個圖片或文件的效果
    */

    $("a#example1").fancybox({
    'titleShow' : true //是否顯示標(biāo)題
    });

    $("a#example2").fancybox({
    'titleShow' : true,
    'transitionIn' : 'elastic',
    'transitionOut' : 'elastic'
    });

    $("a#example3").fancybox({
    'titleShow' : true,
    'transitionIn' : 'none',
    'transitionOut' : 'none'
    });

    $("a#example4").fancybox();

    $("a#example5").fancybox({
    'titlePosition' : 'outside'
    });

    $("a#example6").fancybox({
    'titlePosition' : 'outside'
    });

    /*
    * 設(shè)置id號為various效果
    */

    $("#various1").fancybox({
    'titlePosition' : 'over',//標(biāo)題顯示的位置
    'transitionIn' : 'none',
    'transitionOut' : 'none'
    });

    $("#various2").fancybox();

    $("#various3").fancybox({
    'width' : '75%',
    'height' : '75%',
    'autoScale' : false,
    'transitionIn' : 'fade',
    'transitionOut' : 'fade',
    'type' : 'iframe'

    });

    $("#various4").fancybox({
    'padding' : 0,
    'autoScale' : false, //如果為true,fancybox可以自適應(yīng)瀏覽器窗口大小
    'transitionIn' : 'none',
    'transitionOut' : 'none'

    });
    });
    </script>

    ?

    </head>
    <body>
    <div id="content">
    <h4>jQuery FancyBox 實現(xiàn)點擊小圖顯示大圖</h4>
    <p>
    <a rel="example_group" href="example/4_b.jpg" title="Lorem ipsum dolor sit amet"><img alt="" src="example/4_s.jpg"/></a>

    <a rel="example_group" href="example/5_b.jpg" title=""><img alt="" src="example/5_s.jpg"/></a>

    <a rel="example_group" href="example/6_b.jpg" title=""><img alt="" src="example/6_s.jpg"/></a>
    </p>
    <p>
    <a rel="example_group" href="example/7_b.jpg" title="Lorem ipsum dolor sit amet"><img alt="" src="example/7_s.jpg"/></a>

    <a rel="example_group" href="example/8_b.jpg" title=""><img alt="" src="example/8_s.jpg"/></a>

    <a rel="example_group" href="example/9_b.jpg" title=""><img alt="" src="example/9_s.jpg"/></a>
    </p>
    </div>
    <div><p>&nbsp;</p></div>
    </body>
    </html>

    ?

    轉(zhuǎn)載于:https://www.cnblogs.com/cblx/p/4815249.html

    總結(jié)

    以上是生活随笔為你收集整理的又一个绝对棒的对话框插件fancybox v1.3.4的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。