Visual colors, and visual messages.
Open modal windows for inline content, iframes, images and/or galleries.
<a href="http://wikipedia.com" data-fc-modules="modal">Iframe Link</a>
Link to the image or html and add the data-fc-modules="modal"
<a href="http://www.jacklmoore.com/colorbox/content/ohoopee1.jpg" data-fc-modules="modal">Image Link</a>
Just use the class group-X to group you images
<p><a href="http://www.jacklmoore.com/colorbox/content/ohoopee1.jpg" data-fc-modules="modal" class="group-1">Image Link 1</a></p>
<p><a href="http://www.jacklmoore.com/colorbox/content/ohoopee2.jpg" data-fc-modules="modal" class="group-1">Image Link 2</a></p>
<p><a href="http://www.jacklmoore.com/colorbox/content/ohoopee3.jpg" data-fc-modules="modal" class="group-1">Image Link 3</a></p>
To open a modal window from a inline content in the current page
<a href="#modal" data-fc-modules="modal">Inline Link</a>
<div class="hidden">
<div id="modal">
<a href="#modal-2">
<img src="http://www.thinkstockphotos.es/CMS/StaticContent/WhyThinkstockImages/Best_Images.jpg" />
</a>
</div>
</div>
<a href="#modal-2" data-fc-modules="modal">Inline Link 2</a>
<div class="hidden">
<div id="modal-2">
<a href="#modal">
<img src="http://www.thinkstockphotos.es/CMS/StaticContent/WhyThinkstockImages/Best_Images.jpg" />
</a>
</div>
</div>
To open a modal window from a inline content of something located in other page/url.
<a href="/index.html#features" data-fc-modules="modal">Inline Link</a>
Defines the content to load
Force the width of the modal window. Could be defined as px or %.
DEFAULT: auto
NForce the height of the modal window. Could be defined as px or %.
DEFAULT: auto
Add a class to the #colorbox on open
DEFAULT: null
If you set this to false, the modal behaviour will not be applied if device is a mobile phone or tablet.
DEFAULT: true
Adds a suffic to the href paramater on open modal windows. For example: '?modal=1'
DEFAULT: null
If false, the modal windows will not have close buttonk.
DEFAULT: true
Sometimes you need to call a modal from another module. Take this module as example.
// 1. Define your module and set 'modal' as dependency
FrontendCore.define('myModule', ['modal'], function () {
return {
// 2. Instantiate modal as a object in your module
oModal: TinyCore.Module.instantiate( 'modal' ),
onStart: function () {
// 3. Save into a local var the scope
var self = this;
$('a').on('click',function(event) {
event.preventDefault();
// 4.Open in a modal this href
self.oModal.open({
href: this.href,
width: '90%',
height: '80%',
onComplete: function() {
// This function will be called when modal is rendered
}
});
// 5. Closes the modal window
self.oModal.close();
});
},
onStop: function () {
// 6.Set free some memory when module stops
this.oModal = null;
},
onDestroy: function () {
// 7. Delete oModal to avoid memory problems
delete this.oModal;
}
};
});