Hello everyon,
I have a small jQuery related task to complete, and keep failing to do so, unfortunately. I need to output the value of a custom defined variable, as follows:Below is the code to replace the default value with the custom defined one:Code:$(document).ready(function() { $('#preFeature').siteFeature({ outputElementId: 'CustomSliderName', }); return false; });
I can't figure out how to call the outputElementId variable in a function outside the jQuery class (see the red highlighted text). Could someone tell me the right way to do it, that would be much appreciated, thanks!Code:(function ($) { $.fn.siteFeature = function (b) { var c = $.extend({}, $.fn.siteFeature.defaults, b); return this.each(function (i) { obj = $(this); var a = {}; a.which = i; createFeature(c, a); customizeFeature(c, a); eventFeature(c, a) }) }; $.fn.siteFeature.defaults = { outputElementId: 'siteFeature', }; })(jQuery); function siteFeatureAutoPlayer(a) { var defaultSliderId = jQuery.fn.siteFeature.defaults.outputElementId; // this defines the default ID, works well var sliderID = jQuery.fn.siteFeature.......outputElementId; // need to fix this part }



Reply With Quote
Bookmarks