Another absolutely awesome dialog box plugin FancyBox v1.3.4

Source: Internet
Author: User

The characteristics of FancyBox are as follows:

    1. Support for images, HTML text, Flash animations, iframe, and Ajax
    2. You can customize the CSS style of the player
    3. Can be played as a group
    4. If the mouse scroll plug-in (mouse wheel plugin) included, FancyBox can also support the mouse wheel scroll to flip through the picture
    5. FancyBox Player supports projection, more stereoscopic feel

How to use:

1. Introduction of jquery Core library and FancyBox plugin library

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

Optional-If you need to use fancy transition (some animation effects) You also need to introduce the following script

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

Optional-if you need to support the mouse wheel scrolling effect you also need to introduce the following script

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

2. Add Style sheet file

1 <linkrel="stylesheet" href="/fancybox/jquery.fancybox-1.3.4.css" type="text/css" media="screen"/>
Here is an example of a small scale effect:
<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> <!--call the jquery core Library----->
<script type= "Text/javascript" src= "js/jquery.mousewheel-3.0.2.pack.js" ></script><!--call the available mouse-controlled libraries-- >
<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 () {
/**
Code to run
*/

$ ("A[rel=example_group]"). FancyBox ({
' Transitionin ': ' fade ',//Set animation effect. can be set to ' elastic ', ' fade ' or ' none '
' Transitionout ': ' fade ',//Ibid.
' Titleposition ': ' over ',//sets the position of the caption display. Can be set to ' outside ', ' inside ' or ' over '
' TitleFormat ': function (title, CurrentArray, Currentindex, currentopts) {//can customize the format of the caption
Return ' <span id= ' fancybox-title-over ' >image ' + (Currentindex + 1) + '/' + Currentarray.length + (title.length? ' &nbsp; ' + title: ') + ' </span> ';
}
});

<!-------------------------------------The following are test code, not within the code implemented in this example------------------------------------>
/*
* Individually set the effect of each picture or file
*/

$ ("A#example1"). FancyBox ({
' Titleshow ': true//Whether the caption is displayed
});

$ ("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 '
});

/*
* Set ID number to various effect
*/

$ ("#various1"). FancyBox ({
' Titleposition ': ' over ',//location of title display
' 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,//if the browser window size can be adaptive for True,fancybox
' Transitionin ': ' None ',
' Transitionout ': ' None '

});
});
</script>

<body>
<div id= "Content" >
<p>
<a rel= "Example_group" href= "example/4_b.jpg" title= "Lorem ipsum dolor sit amet" >

<a rel= "Example_group" href= "example/5_b.jpg" title= "" ></a>

<a rel= "Example_group" href= "example/6_b.jpg" title= "" ></a>
</p>
<p>
<a rel= "Example_group" href= "example/7_b.jpg" title= "Lorem ipsum dolor sit amet" >

<a rel= "Example_group" href= "example/8_b.jpg" title= "" ></a>

<a rel= "Example_group" href= "example/9_b.jpg" title= "" ></a>
</p>
</div>
<div><p>&nbsp;</p></div>
</body>

Another absolutely awesome dialog box plugin FancyBox v1.3.4

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.