[jQuery] jQuery Plugin question

[jQuery] jQuery Plugin question

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 <input>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:
<span style="font-family: courier new,monospace;">                $(".slider").each(function() {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                    rangeEl = $(this).siblings().filter("
input.range");</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                    rangeEl.css("border", "1px solid green");</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">                    rangeMax = parseInt(rangeEl.attr("max")) || 100;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
                    rangeMin = parseInt(rangeEl.attr("min")) || 0;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                    rangeVal = parseInt(
rangeEl.val()) || 0;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                    step = parseInt(rangeEl.attr("step"));</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">                    difference = rangeMax - rangeMin;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                    differential = difference /
100.0;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                    $(this).Slider({</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
                        accept: ".indicator", fractions: (difference / step), </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                        onSlide: function(cordx, cordy, x , y) {
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                            rangeEl.val(parseInt((cordx * differential) + rangeMin))</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">                        }</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                    });</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">                    $(this).SliderSetValues([[234 * ((rangeVal - rangeMin) / (difference)),0]]);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
                    rangeEl.val(rangeVal);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                });</span><br clear="all">
What seems to be happening is that the rangeEl element is getting overwritten, and all sliders are using the same (last) element.
--
Yehuda Katz
Web Developer | Wycats Designs
(ph)  718.877.1325
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/