Is there a way to set a variable in an each that will be stored separately for each instance of the plugin (for example, if I am performing an action on all s, is there a way to store the input type and reuse it later?). Maybe I'm not being clear, so here's the example:
$(".slider"
Also most JavaScript compressors depend on the var being their or you
could get undesired results.
--
Brandon Aaron
On 10/4/06, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> Ⓙⓐⓚⓔ schrieb:
> > Javascript doesn't have block scoping, providing only global and
> > function scopes!
> >
> That may be rig
Ⓙⓐⓚⓔ schrieb:
> Javascript doesn't have block scoping, providing only global and
> function scopes!
>
That may be right, but in most cases it is enough to keep your code
clean to prevent problems resulting from the non-existant block scope.
On the other hand, creating global variables causes q
While I agree that var is often missing and global vars are often not
a good idea...
In JS vars are not scoped in a for or if so var inside the for (or
if) does little more than a var before it. This is the reason that we
have to resort to the confusing looking
function(){var x = 1...}();
wh
> Is there a way to set a variable in an each that will be stored
> separately for each instance of the plugin (for example, if I am
> performing an action on all s, is there a way to store the
> input type and reuse it later?). Maybe I'm not being clear, so
> here's the example:
>
>
Create an empty object, pass it to the .each() block, and add each id as a
property of it as you go.
My first crack (which is probably hopelessly b0rked, but may get the point
across...):
var myInputs = {};
function sliderCallback { myInputs[this.id].rangeEl =
$(this).siblings().filter("input.ran