These are my jQuery plugin parameters so far:
function lightbox( options )
{
// setting default parameters
var params = $.extend(
{
// show/hide & enable/disable options
keyNav : true, // boolean
objClickNav: false, // boolean
showNav : true, // boolean
showTitle : true, // boolean
showPagination : true, // boolean
debugMode : false, // boolean
disableScrolling : true, // boolean
fullscreen : false, // boolean
autoScale : true, // boolean
staticHeight: 'auto', // integer or 'auto'
staticWidth: 'auto', // integer or 'auto'
// content options
contentType : 'image', // defines the type of content shown in the lightbox
// options: 'image'
animationType : 'default', // defines the type of animation when switching objects
// options: 'default', 'slide'
}, options);
}
I couldn't find an answer anywhere on the internet, so that's why I'm asking it here. I want to have an extend()
inside the current extend()
, so I can declare my plugin like this:
lightbox({
keyNav : true,
showNav : false,
scale({
autoScale : false,
staticHeight : 800,
})
content({
contentType : 'image',
animationType : 'slide',
})
});
What is the correct way of doing this?