JQuery Questine
- Started
- Last post
- 5 Responses
- ESKEMA0
^^ this is what I've done, and I said it right on the first post, I was just curious to know if I could do it directly on the plugin option..
Cheers guys
- ideaist0
It depends on the plugin ESKEMA; check its website for the API.
- instrmntl0
why not have that outside your instantiation first, then pass it?
- uan0
if you can address it as object maybe something like this
. pluginName . option3 = (function option3() {
if ($("selector") . hasClass("whatever")) {
return value X;
} else {
return value Y;
}
} ) ();
- section_0140
Maybe a closure?
option3: return function(){..if statement here...}
I like instrmntl's idea of setting the value ahead of time more. Something like:
var option3value;
if($("selector") . hasClass("whatever")) {option3value = X } else { option3value = Y }
$('#selector') . pluginName({
option1: value,
option2: value,
option3: option3value,
option4: value,
});