still doesn't work.. I simplified the plug in to:

$.fn.rolly = function(options) {
        var settings = $.extend({
                speed: 'fast',
                delay: 10000
        }, options || {});
        var self = this;
        var rollover = function() {
                self.children().eq(0).appendTo(self);
                setTimeout(rollover, settings.delay);
        };
        rollover();
};

my infinite recursion is working fine.. but the imgs are not rolling
around... I want to take the first child img and move it to the last.



On 10/15/06, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> Ⓙⓐⓚⓔ schrieb:
> > I think we're on the right track but now I get a firefox exception.
> >
> > http://cigar.dynalias.org/js/rolly.js
> >
> Try this:
>
> $.fn.rolly = function(options) {
>         var settings = $.extend({
>                 speed: 'fast',
>                 delay: 10000
>         }, options || {});
>         $(this).children().eq(0).animate({ width: 'hide', opacity: 'hide' }, 
> settings.speed).appendTo(this).show(settings.delay);
> };
>
> You don't have to use $.blabla = function() ... if your plugin is simple
> enough. Define simple helper functions within your plugin function, that
> should suffice in this case. But if you delegate to other function, you
> must pass "this", too. Something like this:
>
> $.fn.rolly = function(options) {
>         var settings = $.extend({
>                 speed: 'fast',
>                 delay: 10000
>         }, options || {});
>         var helper = function(jq) {
>                 jq.children().eq(0).animate({ width: 'hide', opacity: 'hide' 
> }, settings.speed).appendTo(this).show(settings.delay);
>         };
>         helper(this);
> };
>
> Or you save "this" into a variable and use it within the function:
>
>
> $.fn.rolly = function(options) {
>         var settings = $.extend({
>                 speed: 'fast',
>                 delay: 10000
>         }, options || {});
>         var jq = this;
>         var helper = function() {
>                 jq.children().eq(0).animate({ width: 'hide', opacity: 'hide' 
> }, settings.speed).appendTo(this).show(settings.delay);
>         };
>         helper();
>         setTimeout(helper, settings.delay);
> };
>
> Hope that helps.
>
> -- Jörn
>
>
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>


-- 
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to