How can I change a width parameter in jQuery given as a pixels integer into a percentage?
<p>I'm working with a custom scrolling <code>div</code> jQuery plugin. I want the <code>div</code> to fill 100% of the width of its parent to change size depending on the browser window size. </p>

<p>The script takes a given <code>width</code> parameter, and uses it throughout the script. The customizable parameters of the script seem to only allow me to specify the <code>width</code> in pixels, as an integer:</p>

<pre><code>$.fn.hoverscroll.params = {

vertical:   false,      // Display the list vertically or not
width:      1280,        // Width of the list
height:     230,         // Height of the list
arrows:     true,       // Display arrows to the left and top or the top and bottom
arrowsOpacity:  0.4,    // Maximum opacity of the arrows if fixedArrows
fixedArrows: false,     // Fix the displayed arrows to the side of the list
rtl:        false,      // Set display mode to "Right to Left"
debug:      false       // Display some debugging information in firebug console

};
</code></pre>

<p>I tried quoting the percentage, <code>'100%'</code>, but that didn't work. Is there a way to use a percentage here? </p>

<p>If not, is there a way to use a script like the one below, which determines the width of the window, make the script output the width in pixels, and use that integer as the <code>width</code> parameter in the jQuery script?</p>

<pre><code>&lt;script type="text/javascript"&gt;
    function alertSize() {
    var myWidth = 0;
    if( typeof( window.innerWidth ) == 'number' ) {

    //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement &amp;&amp; ( document.documentElement.clientWidth ) ) {

    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body &amp;&amp; ( document.body.clientWidth ) ) {

    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
    //window.alert( myWidth );
}
&lt;/script&gt;
</code></pre>

<p>For reference, here is the full script of the plugin that I'm using:
<a href="http://rascarlito.free.fr/hoverscroll/js/hoverscroll/jquery.hoverscroll.js" rel="nofollow">http://rascarlito.free.fr/hoverscroll/js/hoverscroll/jquery.hoverscroll.js</a></p>
