All of my elements which init by my jquery plugin sharing the same local variable when it running. I did a test and found out because this line:
var tmp1 = tmp2 = weird_local_var = 0;
If I write like below, it does not happens
var normal_local_var = 0;
It is not because tmp1 & tmp2, just dummy var for testing. You can see the test via http://jsfiddle.net/7SeRD/. What happen?
You can just change your init line to:
EDIT: See this answer too: link.
From it:
What you’re doing is chaining assignments.
You’re essentially assigning a reference to weird_local_var (whose value is 0) to tmp2, then assigning a reference to that reference (ie tmp1 -> tmp2) to tmp1.