• Jquery — fancybox


    jquery fancybox

     

    参考 http://fancyapps.com/fancybox/

    Instructions

    Download the plugin, unzip it, copy files and include fancyBox script and stylesheet in your document (you will need to make sure the css and js files are on your server, and adjust the paths in the script and link tag). Make sure you also load the jQuery library. Example:

     

    <!-- Add jQuery library -->
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>

    <!-- Add mousewheel plugin (this is optional) -->
    <script type="text/javascript" src="/fancybox/lib/jquery.mousewheel-3.0.6.pack.js"></script>

    <!-- Add fancyBox -->
    <link rel="stylesheet" href="/fancybox/source/jquery.fancybox.css?v=2.0.4" type="text/css" media="screen" />
    <script type="text/javascript" src="/fancybox/source/jquery.fancybox.pack.js?v=2.0.4"></script>

    <!-- Optionaly add button and/or thumbnail helpers -->
    <link rel="stylesheet" href="/fancybox/source/helpers/jquery.fancybox-buttons.css?v=2.0.4" type="text/css" media="screen" />
    <script type="text/javascript" src="/fancybox/source/helpers/jquery.fancybox-buttons.js?v=2.0.4"></script>

    <link rel="stylesheet" href="/fancybox/source/helpers/jquery.fancybox-thumbs.css?v=2.0.4" type="text/css" media="screen" />
    <script type="text/javascript" src="/fancybox/source/helpers/jquery.fancybox-thumbs.js?v=2.0.4"></script>

    Create link elements whose href attributes will contain the path of the element you wish to open within the fancyBox.

     

    <a class="fancybox" rel="group" href="big_image_1.jpg"><img src="small_image_1.jpg" alt="" /></a>
    <a class="fancybox" rel="group" href="big_image_2.jpg"><img src="small_image_2.jpg" alt="" /></a>

    Attach fancyBox when the document is loaded. If you are not familiar with jQuery, please, read this tutorial for beginners.

     

    <script type="text/javascript">
    $(document).ready(function() {
    $(".fancybox").fancybox();
    });
    </script>

     

    Examples

    <ul class="list">
    <li>
    <a class="various fancybox.ajax" href="/demo/ajax.php">Ajax</a>
    </li>
    <li>
    <a class="various fancybox.iframe" href="http://jquery.com/">Iframe</a>
    </li>
    <li>
    <a class="various" href="#inline">Inline</a>
    </li>
    <li>
    <a class="various" href="http://www.adobe.com/jp/events/cs3_web_edition_tour/swfs/perform.swf">SWF</a>
    </li>
    </ul>

    <ul class="list">
    <li>
    <a class="various fancybox.iframe" href="http://www.youtube.com/embed/L9szn1QQfas?autoplay=1">Youtube (iframe)</a>
    </li>
    <li>
    <a class="various fancybox.iframe" href="http://maps.google.com/?output=embed&f=q&source=s_q&hl=en&geocode=&q=London+Eye,+County+Hall,+Westminster+Bridge+Road,+London,+United+Kingdom&hl=lv&ll=51.504155,-0.117749&spn=0.00571,0.016512&sll=56.879635,24.603189&sspn=10.280244,33.815918&vpsrc=6&hq=London+Eye&radius=15000&t=h&z=17">Google maps (iframe)</a>
    </li>
    <li>
    <a class="various" href="/data/non_existing_image.jpg">Non-existing url</a>
    </li>
    </ul>

    Javascript

    $(document).ready(function() {
    $(".various").fancybox({
    maxWidth : 800,
    maxHeight : 600,
    fitToView : false,
    width : '70%',
    height : '70%',
    autoSize : false,
    closeClick : false,
    openEffect : 'none',
    closeEffect : 'none'
    });
    });

    Download

    https://github.com/fancyapps/fancyBox/zipball/v2.0.4








  • 相关阅读:
    基本概念和术语
    Html中的<label>标签
    shell17echo打印带颜色的文字
    shell-15 &的三种不同
    shell-14 多个命令以分号隔开
    shell-13 tee管道可以重定向但是不截流
    shell-12实用cat完成文件复制
    shell-11输入内容到文件
    shell-10kill杀死作业号和进程号
    shell-9前后台切换
  • 原文地址:https://www.cnblogs.com/bruceleeliya/p/2303172.html
Copyright © 2020-2023  润新知