Accessing plugin options from "sub" function
<p>I'm trying to build a logo slider plugin after I read this tutorial: <a href="http://www.learningjquery.com/2007/10/a-plugin-development-pattern" rel="nofollow">http://www.learningjquery.com/2007/10/a-plugin-development-pattern</a></p>

<p>My problem is, that I need to access the options set when the plugin was initialized, and not just the defaults.</p>

<p>Does it make sense?</p>

<pre><code>            $.fn.oSlider = function(options) {

                var options = $.extend({}, $.fn.oSlider.defaults, options);

                return this.each(function() {

                    $wrapper = $('&lt;div class="oslider wrap" /&gt;');
                    $obj = $(this);

                    $wrapper.css({
                        'width' : $obj.width() +'px',
                        'height' : $obj.height() +'px'
                    });             
                    $obj.css('width','15000px');

                    $.fn.oSlider.nextImg($obj);
                });

            };

            $.fn.oSlider.defaults = {
                    duration : 1000,
                    delay : 1000                    
            };

            $.fn.oSlider.nextImg = function(obj) {
                alert($.fn.oSlider.options.duration);
                $obj = $(obj);
                $currImg = $obj.find('img:first');
                $obj
                .css('position','absolute')
                .wrap($wrapper)
                .animate({
                    'left' : '-' + $currImg.width() + 'px'

                    },{
                        'duration' : $.fn.oSlider.defaults.duration,
                        'complete' : function() {
                            $obj.css('left','0');
                            $currImg.clone().appendTo($obj);
                            $currImg.remove();
                            setTimeout("$.fn.oSlider.nextImg($obj)",$.fn.oSlider.defaults.delay);
                        }
                });
            };  
</code></pre>

<p>Oh and this is the HTML code:</p>

<pre><code>&lt;style type="text/css"&gt;
            body { background: #333; }
            .oslider.wrap { position: relative; overflow: hidden; }
            div#logos { height: 80px; width: 500px; position: relative; }
            div#logos img { float: left; border: 0; max-height: 80px; display: inline; }

    &lt;/style&gt;                
&lt;/head&gt;
&lt;body&gt;

    &lt;div id="logos"&gt;
        &lt;img src="logo/17.gif" alt="" /&gt;
        &lt;img src="logo/6.jpg" alt="" /&gt;
        &lt;img src="logo/14.jpg" alt="" /&gt;
        &lt;img src="logo/10.gif" alt="" /&gt;
        &lt;img src="logo/12.gif" alt="" /&gt;
        &lt;img src="logo/19.jpg" alt="" /&gt;
        &lt;img src="logo/21.jpg" alt="" /&gt;
        &lt;img src="logo/15.gif" alt="" /&gt;
        &lt;img src="logo/22.jpg" alt="" /&gt;
        &lt;img src="logo/9.gif" alt="" /&gt;
        &lt;img src="logo/13.gif" alt="" /&gt;
        &lt;img src="logo/11.jpg" alt="" /&gt;
    &lt;/div&gt;

&lt;/body&gt;
</code></pre>
