I’m creating a basic jquery plugin but the extend doesn’t seem to work..
I’m calling the plugin in below manner
$('#ccontainer').slide("/json/service.json",6000,700,'true','true','right','800px');
Plugin
(function($) {
$.fn.slide = function(settings) {
var options = {
service : '',
slideAnimationTime : 5000,
slideSpeed : 800,
onHoverPause : 'true',
autoSlide : 'true',
direction : 'right',
width : ''
};
$.extend(options , settings);
console.log(options.slideSpeed); //doesn't show up new settings as 700 in above case but instead shows old value 800
}
I think you need to explicitly pass in an object like: