JQuery\Javascript - Passing a function as a variable
<p>I was just curious if I could pass a function as a variable. For example:
I have a function</p>

<pre><code>$('#validate').makeFloat({x:671,y:70,limitY:700});
</code></pre>

<p>I would like to do something like this:</p>

<pre><code>$('#validate').makeFloat({x:function(){ return $("#tabs").offset().left+$("#tabs").width();},y:70,limitY:700});
</code></pre>

<p>This does not work, but ideally every time the variable was accessed it would compute the new value. So if the window was resized it would automatically adjust as opposed to a variable passed in being static. I realize I can implement this directly inside the function\widget, but I was wondering if there was some way to do something like the above.</p>

<p>The concept of this is independent of the plugin. I am talking about the function being "cast" as a variable.</p>
