{"_id":"jquery.fancybox","_rev":"2-81aa2d5150570b5428bd650d24c5bf2e","name":"jquery.fancybox","description":"fancyBox offers an elegant way to present images, html content and multimedia for webpages","dist-tags":{"latest":"2.1.5"},"versions":{"2.1.5":{"name":"jquery.fancybox","title":"fancyapps/fancyBox","description":"fancyBox offers an elegant way to present images, html content and multimedia for webpages","keywords":["lightbox","effect","responsive","modal","window","ui"],"licenses":[{"type":"fancyBox","url":"http://fancyapps.com/fancybox/#license"}],"version":"2.1.5","repository":{"type":"git","url":"git+https://github.com/fancyapps/fancyBox.git"},"dependencies":{},"devDependencies":{},"engines":{"node":">=0.10.0"},"bugs":{"url":"https://github.com/fancyapps/fancyBox/issues"},"homepage":"https://github.com/fancyapps/fancyBox#readme","main":"source/jquery.fancybox.pack.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"fancyapps"},"license":"CC-BY-NC-3.0","_id":"jquery.fancybox@2.1.5","_shasum":"e7176c1ada80c0c6461a2cc149fefe5253e02c04","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.2","_npmUser":{"name":"folmert","email":"lukasfolmert@gmail.com"},"dist":{"shasum":"e7176c1ada80c0c6461a2cc149fefe5253e02c04","tarball":"https://registry.npmjs.org/jquery.fancybox/-/jquery.fancybox-2.1.5.tgz","integrity":"sha512-ad0lIQKK/arkg2khcr22gVomVFYPeUFFUmdZwvWCwbpPofK5ZRHcxEpV7KKR0I/QEdhMf3YYqTaMOWsQIYKpOg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYY/Bu64nf6lMHUx6g2uPIHTzoaHf/ZaUTtXCadkFx6wIgKVFb8bGk8hN+IMUbHt43XPsGkzfLmqVPXhi5vXJejRE="}]},"maintainers":[{"name":"folmert","email":"lukasfolmert@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/jquery.fancybox-2.1.5.tgz_1487091736486_0.4978481961879879"}}},"readme":"fancyBox\n========\n\nfancyBox is a tool that offers a nice and elegant way to add zooming functionality for images, html content and multi-media on your webpages.\n\nMore information and examples: http://www.fancyapps.com/fancybox/\n\nLicense: http://www.fancyapps.com/fancybox/#license\n\nCopyright (c) 2012 Janis Skarnelis - janis@fancyapps.com\n\n\nHow to use\n----------\n\nTo get started, download the plugin, unzip it and copy files to your website/application directory.\nLoad files in the <head> section of your HTML document. Make sure you also add the jQuery library.\n\n```html\n<head>\n    <script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js\"></script>\n    <link rel=\"stylesheet\" href=\"/fancybox/jquery.fancybox.css\" type=\"text/css\" media=\"screen\" />\n    <script type=\"text/javascript\" src=\"/fancybox/jquery.fancybox.pack.js\"></script>\n</head>\n```\n\nCreate your links with a `title` (or `data-fancybox-title`) if you want a title to be shown, and add a class:\n\n```html\n<a href=\"large_image.jpg\" class=\"fancybox\" title=\"Sample title\"><img src=\"small_image.jpg\" /></a>\n```\n\nIf you have a set of related items that you would like to group,\nadditionally include a group name in the `rel` (or `data-fancybox-group`) attribute:\n\n```html\n<a href=\"large_1.jpg\" class=\"fancybox\" rel=\"gallery\" title=\"Sample title 1\"><img src=\"small_1.jpg\" /></a>\n<a href=\"large_2.jpg\" class=\"fancybox\" rel=\"gallery\" title=\"Sample title 1\"><img src=\"small_2.jpg\" /></a>\n```\n\nInitialise the script like this:\n\n```html\n<script>\n    $(document).ready(function() {\n        $('.fancybox').fancybox();\n    });\n</script>\n```\n\nMay also be passed an optional options object which will extend the default values. Example:\n\n```html\n<script>\n    $(document).ready(function() {\n        $('.fancybox').fancybox({\n            padding : 0,\n            openEffect  : 'elastic',\n            closeBtn: false\n        });\n    });\n</script>\n```\n\nTip: Automatically group and apply fancyBox to all images:\n\n```js\n$(\"a[href$='.jpg'],a[href$='.jpeg'],a[href$='.png'],a[href$='.gif']\").attr('rel', 'gallery').fancybox();\n```\n\nScript uses the `href` attribute of the matched elements to obtain the location of the content and to figure out content type you want to display.\nYou can specify type directly by adding classname (fancybox.image, fancybox.iframe, etc) or `data-fancybox-type` attribute:\n\n```html\n//Ajax:\n<a href=\"/example.html\" class=\"fancybox fancybox.ajax\">Example</a>\n//or\n<a href=\"/example.html\" class=\"fancybox\" data-fancybox-type=\"ajax\">Example</a>\n\n//Iframe:\n<a href=\"example.html\" class=\"fancybox fancybox.iframe\">Example</a>\n\n//Inline (will display an element with `id=\"example\"`)\n<a href=\"#example\" class=\"fancybox\">Example</a>\n\n//SWF:\n<a href=\"example.swf\" class=\"fancybox\">Example</a>\n\n//Image:\n<a href=\"example.jpg\" class=\"fancybox\">Example</a>\n```\n\nNote, ajax requests are subject to the [same origin policy](http://en.wikipedia.org/wiki/Same_origin_policy).\nIf fancyBox will not be able to get content type, it will try to guess based on 'href' and will quit silently if would not succeed.\n(this is different from previsous versions where 'ajax' was used as default type or an error message was displayed).\n\nAdvanced\n--------\n\n### Helpers\n\nHelpers provide a simple mechanism to extend the capabilities of fancyBox. There are two built-in helpers - 'overlay' and 'title'.\nYou can disable them, set custom options or enable other helpers. Examples:\n\n```js\n//Disable title helper\n$(\".fancybox\").fancybox({\n    helpers:  {\n        title:  null\n    }\n});\n\n//Disable overlay helper\n$(\".fancybox\").fancybox({\n    helpers:  {\n        overlay : null\n    }\n});\n\n//Change title position and overlay color\n$(\".fancybox\").fancybox({\n    helpers:  {\n        title : {\n            type : 'inside'\n        },\n        overlay : {\n            css : {\n                'background' : 'rgba(255,255,255,0.5)'\n            }\n        }\n    }\n});\n\n//Enable thumbnail helper and set custom options\n$(\".fancybox\").fancybox({\n    helpers:  {\n        thumbs : {\n            width: 50,\n            height: 50\n        }\n    }\n});\n```\n\n### API\n\nAlso available are event driven callback methods.  The `this` keyword refers to the current or upcoming object (depends on callback method). Here is how you can change title:\n\n```js\n$(\".fancybox\").fancybox({\n    beforeLoad : function() {\n        this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');\n\n        /*\n            \"this.element\" refers to current element, so you can, for example, use the \"alt\" attribute of the image to store the title:\n            this.title = $(this.element).find('img').attr('alt');\n        */\n    }\n});\n```\n\nIt`s possible to open fancyBox programmatically in various ways:\n\n```js\n//HTML content:\n$.fancybox( '<div><h1>Lorem Lipsum</h1><p>Lorem lipsum</p></div>', {\n    title : 'Custom Title'\n});\n\n//DOM element:\n$.fancybox( $(\"#inline\"), {\n    title : 'Custom Title'\n});\n\n//Custom object:\n$.fancybox({\n    href: 'example.jpg',\n    title : 'Custom Title'\n});\n\n//Array of objects:\n$.fancybox([\n    {\n        href: 'example1.jpg',\n        title : 'Custom Title 1'\n    },\n    {\n        href: 'example2.jpg',\n        title : 'Custom Title 2'\n    }\n], {\n    padding: 0\n});\n```\n\nThere are several methods that allow you to interact with and manipulate fancyBox, example:\n\n```js\n//Close fancybox:\n$.fancybox.close();\n```\n\nThere is a simply way to access wrapping elements using JS:\n\n```js\n$.fancybox.wrap\n$.fancybox.skin\n$.fancybox.outer\n$.fancybox.inner\n```\n\nYou can override CSS to customize the look. For example, make navigation arrows always visible,\nchange width and move them outside of area (use this snippet after including fancybox.css):\n\n```css\n.fancybox-nav span {\n    visibility: visible;\n}\n\n.fancybox-nav {\n    width: 80px;\n}\n\n.fancybox-prev {\n    left: -80px;\n}\n\n.fancybox-next {\n    right: -80px;\n}\n```\n\nIn that case, you might want to increase space around box:\n\n```js\n$(\".fancybox\").fancybox({\n    margin : [20, 60, 20, 60]\n});\n```\n\nBug tracker\n-----------\n\nHave a bug? Please create an issue on GitHub at https://github.com/fancyapps/fancyBox/issues\n","maintainers":[{"name":"folmert","email":"lukasfolmert@gmail.com"}],"time":{"modified":"2022-06-19T05:19:53.216Z","created":"2017-02-14T17:02:18.676Z","2.1.5":"2017-02-14T17:02:18.676Z"},"homepage":"https://github.com/fancyapps/fancyBox#readme","keywords":["lightbox","effect","responsive","modal","window","ui"],"repository":{"type":"git","url":"git+https://github.com/fancyapps/fancyBox.git"},"author":{"name":"fancyapps"},"bugs":{"url":"https://github.com/fancyapps/fancyBox/issues"},"license":"CC-BY-NC-3.0","readmeFilename":"README.md"}