Containers documentation
<link rel='stylesheet' href='../../HTWF/scripts/magnific-popup.css'> <script src='../../HTWF/scripts/jquery.magnific-popup.min.js'></script>
<a class="lightbox" href="http://www.framework-y.com/images/thumb.png"> ... </a>
<a class="lightbox" data-lightbox-anima="show-scale" href="http://www.framework-y.com/images/thumb.png"> ... </a>
<a id="lightbox-demo" href="http://www.framework-y.com/images/thumb.png"> ... </a> <script> $(document).ready(function () { $('#lightbox-demo').magnificPopup({ type: 'image' }); }); </script>
<div onclick="$.magnificPopup.open({ items: { src: 'http://www.framework-y.com/images/thumb.png' }, type: 'image' });"></div>
<!-- EXAMPLE CUSTOM HTML LIGHTBOX --> <div id="demo-id" class="box-lightbox" data-trigger="load" data-lightbox-anima="fade-top"> ... </div> <!-- EXAMPLE YOUTUBE VIDEO LIGHTBOX --> <div class="box-lightbox" data-trigger="load" data-lightbox-anima="fade-left" data-link="https://www.youtube.com/watch?v=bpqhStV2_rc"> ... </div>
<!-- EXAMPLE CUSTOM HTML LIGHTBOX --> <a class="lightbox-trigger" data-trigger="scroll" href="#demo-id"></a> <div id="demo-id" class="box-lightbox" data-trigger="scroll" data-lightbox-anima="fade-top"> ... </div> <!-- EXAMPLE YOUTUBE VIDEO LIGHTBOX --> <a class="lightbox-trigger" data-trigger="scroll" href="#demo-id"></a> <div id="demo-id" class="box-lightbox" data-trigger="scroll" data-lightbox-anima="fade-left" data-link="https://www.youtube.com/watch?v=bpqhStV2_rc"> ... </div>
Name | Type | Description |
---|---|---|
HTML initialization | CSS class |
Add class lightbox to lightbox link, href attribute is the link (or content) of the lightbox.
Example: <a class="lightbox" href="content-link"> ... </a> .
|
Javascript initialization | Javascript |
To make a link lightbox ready use function $('#target').magnificPopup({ type: 'content-type' }); . When link is clicked lightbox is open.
|
HTML settings | Data attribute |
Most of settings can be passed through data-options attribute: data-options="option:value,option:value, ..." .
Full options here.
|
Javascript direct opening | Javascript |
You can open a lightbox directly with Javascript function $.magnificPopup.open({ items: { src: 'content-link' }, type: 'content-type' });
Open lightbox |
Animations | HTML |
Add attribute data-lightbox-anima="animation-name" to lightbox object.Example: <a class="lightbox" href="content-link" data-lightbox-anima="fade-left"> ... </a> .You can use animations also with <a class="lightbox" href="content-link" data-options="anima:animation-name"> ... </a> .Animations list available on animation page. Plugin dependencyThis feature require Animations component ( |
Show on load | HTML |
Create a HTML element with class .box-lightbox and data attribute data-trigger="load" .
You can add settings as usually, like data-options and data-lightbox-anima .
If you want show the custom HTML content you must add also a unique ID
If you want show other content types use the attribute data-link="link youtube or others link" .
Use data-click="your-link" to redirect to a new page when user click the box, use data-click-target="_blank" for open in a new window.
Use data-expire="123" to hide the lightbox for 123 days after the first time is showed. Set to 0 for reset.
|
Show on scroll | HTML |
To show lightbox on page scroll, when user go to a specified area of page, you must add a trigger
link with class lightbox-trigger , data attribute data-trigger="scroll" and href="id-lightbox" . The trigger link can
be hidden but must not use CSS value display:none , after this insert the lightbox element with data attribute data-trigger="scroll"
element like examples above.
|
Youtube and video attributes | String |
If you need to add some attribute to Youtube (or other) link. Use ? instead of & .
Example: https://www.youtube.com/watch?v=HIfDatvJbLM?rel=0 rel=0 is the attribute.
|
Global lightbox | CSS |
You can convert every image link automatically to lightbox with class lightbox-global .
Add this class to the container of the images, for convert all the images of a page add the class to the body.
The links must not have the class lightbox.
|
Deep linking | URL |
Grid and masonry listsTo open the lightbox of a grid or masonry item on page load use the urlwww.your-site.com?lightbox=list-123 .
Replace 123 with item number you want to open. If you have multiple grids use the url www.your-site.com?lightbox=list-123&id=YOUR-ID .
Replace YOUR-ID with the ID of the container of the grid list you want to open. Only image box components are supported.
SlidersTo open the lightbox of a slider item on page load use the urlwww.your-site.com?lightbox=slide-123 .
Replace 123 with slide number you want to open. If you have multiple sliders use the url www.your-site.com?lightbox=slide-123&id=YOUR-ID .
Replace YOUR-ID with the ID of the container of the sliders you want to open. Only image box components are supported.
Single itemTo open a single item by id use the urlwww.your-site.com?lightbox=YOUR-ID
Supported components: image-box, buttons, custom lightbox with class box-lightbox and all objects with class lightbox .
|
<a class="lightbox" href="http://www.framework-y.com/images/thumb-large.png"> ... </a>
<!--Youtube--> <a class="lightbox" href="https://www.youtube.com/watch?v=bpqhStV2_rc"> ... </a></a> <!--Vimeo--> <a class="lightbox" href="https://vimeo.com/162564288"> ... </a></a> <!--MP4 video--> <a class="lightbox" href="video.mp4"> ... </a>
<a class="lightbox" href="https://maps.google.com/maps?q=221B+Baker+Street,+London,+United+Kingdom&hl=en&t=v&hnear=221B+Baker+St,+London+NW1+6XE,+United+Kingdom"> ... </a>
<a class="lightbox" href="#ID-demo"> ... </a> <div id="ID-demo" class="box-lightbox"> ... </div>
<a class="lightbox" href="#ID-demo"> ... </a> <div id="ID-demo" class="box-lightbox"> <div class="scroll-content" data-height=".box-lightbox"> ... </div> </div>
<a class="lightbox" href="#ID"> ... </a> <div id="ID" class="box-lightbox"> <div class="flexslider" data-trigger="manual" id="slider-nav-thumb" data-options="controlNav:false,animationLoop:false,slideshow:false,sync:#carousel-nav-thumb"> <ul class="slides"> <li> <img src="http://www.framework-y.com/images/thumb-large.png" /> </li> <li> <img src="http://www.framework-y.com/images/thumb-large.png" /> </li> </ul> </div> <div id="carousel-nav-thumb" data-trigger="manual" class="flexslider carousel nav-thumb" data-options="controlNav:false,animationLoop:false,slideshow:false,asNavFor:#slider-nav-thumb,minWidth:80"> <ul class="slides"> <li class="flex-active-slide"> <img src="http://www.framework-y.com/images/thumb-wide.png" /> </li> <li> <img src="http://www.framework-y.com/images/thumb-wide.png" /> </li> </ul> </div> </div>
<a class="lightbox" href="http://www.framework-y.com/images/thumb-large.png" title="This is the text caption"> ... </a>
<a class="lightbox" href="http://www.framework-y.com/images/thumb-large.png" title="This is the text caption" data-options="mainClass:inner"> ... </a>
Name | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Video lightbox | Mixed | For video lightbox simple add URL of video, like demos above. | ||||||||||
Google Maps | Mixed |
Use link https://maps.google.com/maps?q= and append your address, replace spaces with + . You can copy address link from Google maps URL of your browser.Example: https://maps.google.com/maps?q=New+York,+United+States is link of this Google Map.
|
||||||||||
Custom HTML | Mixed |
To show a custom HTML box set the href attribute with the ID or class of custom HTML box and add class box-lightbox .
|
||||||||||
Scroll box | Mixed |
To show a scrollable box insert the content into <div class="scroll-content" data-height=".box-lightbox"> ... </div> .
Plugin dependencyThis feature require Slim Scroll Plugin ( |
||||||||||
Slider | Mixed |
To show a slider create a custom HTML box and insert the slider code.
Plugin dependencyThis feature require Flex Slider Plugin ( |
||||||||||
Text caption | Mixed |
To show a texd caption add attribute title="Your text" to lightbox link. For inner text caption add attribute data-options="mainClass:inner" .
|
||||||||||
Lightbox sizes | CSS class |
You can set your own lightbox height and width via CSS or you can use the 4 built-in sizes:
Lorem ipsum dolor sitamet consectetur adipisicing elito sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea coSed ut perspiciatis unde omnis iste natus error
sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaqueipsa quae ab illo inventore veritatis et quasi architecto beatae
vitae dicta sunt explicabo.
Lorem ipsum dolor sitamet consectetur adipisicing elito sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea coSed ut perspiciatis unde omnis iste natus error
sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaqueipsa quae ab illo inventore veritatis et quasi architecto beatae
vitae dicta sunt explicabo.
Lorem ipsum dolor sitamet consectetur adipisicing elito sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea coSed ut perspiciatis unde omnis iste natus error
sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaqueipsa quae ab illo inventore veritatis et quasi architecto beatae
vitae dicta sunt explicabo.
Lorem ipsum dolor sitamet consectetur adipisicing elito sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea coSed ut perspiciatis unde omnis iste natus error
sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaqueipsa quae ab illo inventore veritatis et quasi architecto beatae
vitae dicta sunt explicabo.
|
<div class="grid-list gallery thumb-xs"> <div class="grid-box row"> <div class="row"> <div class="col-md-2"> <a class="img-box thumbnail" href="http://www.framework-y.com/images/thumb-large.png"> <span><img src="http://www.framework-y.com/images/thumb-wide.png"></span> </a> </div> <div class="col-md-2"> <a class="img-box thumbnail mfp-iframe" href="https://www.youtube.com/watch?v=bpqhStV2_rc"> <span><img src="http://www.framework-y.com/images/thumb-wide.png"></span> </a> </div> </div> </div> </div>
Lightbox gallery is part of Grid list component. Complete documentation here