problem in passing a variable to a function
hi
sorry if this is such a obvious question, but i'm kind of newbie in JQuery,
i am using a lightpop plugin, & i want to pass 'image_path' via html.
lightpop plugin code is something like this:
- (function(jQuery){
jQuery.browser = jQuery.extend(
{chrome: /chrome/i.test(navigator.userAgent)} ,
jQuery.browser
);
jQuery.fn.lightpop = function(settings, fileTypes, plugin_name, image_path, pre_image, pre_icon){
document._write = document.write;
plugin_name = plugin_name || 'lightpop';
image_path = image_path || 'images/';
pre_image = pre_image || image_path + plugin_name + '-';
pre_icon = pre_icon || image_path + 'icon-';
settings = jQuery.extend( true, {
overlayBgColor: '#000' ,
overlayOpacity: 0.7 ,
contentFrameType: 'border' ,
contentBorder: 'none' ,
boxBorderSize: 6 ,
containerBorderSize: 10 ,
containerResizeSpeed: 'normal' ,
contentBgColor: '#FFF' ,
imageBox: pre_image + 'box.gif' ,
imageBorderL: pre_image + 'border-l.gif' ,
imageBorderR: pre_image + 'border-r.gif' ,
imageLoading: pre_image + 'ico-loading.gif'
in my html try these, but none of them didn't work out:
- $('a[href$=.jpg], a[href$=.gif], a[href$=.png]').lightpop(image_path = 'http://localhost/img/');
- $('a[href$=.jpg], a[href$=.gif], a[href$=.png]').lightpop({image_path : 'http://localhost/img/'});