Hi, i need some help with Effect.Appear/Effect.Fade i would like fade in and out an element on hovering an element(-> tooltip behavior), but when i''m using Effect.Appear/Effect.Fade both effects will continue to play and overlap each other, resulting in unpredictable behavior. <code> <button onmouseover="Effect.Appear(''test_div2'')" onmouseout="Effect.Fade(''test_div'')">TRIGGER</button> <div id="test_div" style="width: 100px; height: 100px; background-color: #FF33CC;">TEST</div> </code> So i need some advice how to stop a running effect for an element, so i can start the opposite effect. I also tried to work with Effect.toggle, but this will just add all new effects to the end of the queue, instead of stopping the running effect and start the intended one immediately. (in my opinion Effect.toggle is doing this wrong - if a user clicks a toggle button very often, or is hovering a trigger very fast and often the animation will go on, and on, and on...) thanks for your help matthias
Initialize your function with: this._effect = new Effect... And then use this to cancel it: effect.cancel() Matthias Platzer a écrit :> > Hi, > > i need some help with Effect.Appear/Effect.Fade > > i would like fade in and out an element on hovering an element(-> > tooltip behavior), but when i''m using Effect.Appear/Effect.Fade both > effects will continue to play and overlap each other, resulting in > unpredictable behavior. > > <code> > <button onmouseover="Effect.Appear(''test_div2'')" > onmouseout="Effect.Fade(''test_div'')">TRIGGER</button> > <div id="test_div" style="width: 100px; height: 100px; background-color: > #FF33CC;">TEST</div> > </code> > > > So i need some advice how to stop a running effect for an element, so i > can start the opposite effect. > > I also tried to work with Effect.toggle, but this will just add all new > effects to the end of the queue, instead of stopping the running effect > and start the intended one immediately. (in my opinion Effect.toggle is > doing this wrong - if a user clicks a toggle button very often, or is > hovering a trigger very fast and often the animation will go on, and on, > and on...) > > thanks for your help > matthias > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >___________________________________________________________________________ Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l''international. Téléchargez sur http://fr.messenger.yahoo.com
i also thought about that solution. but i would be happier, if i can find all running effects for an element and stop them, but your proposed solution might do it as well. ?is there any opinion on this list about the problem with opposite effects not stopping (toggle) -> i would rather like to fix that in the core than to write a workaround. matthias kiplantt schrieb:> Initialize your function with: > this._effect = new Effect... > > And then use this to cancel it: > effect.cancel() > > Matthias Platzer a écrit : >> >> Hi, >> >> i need some help with Effect.Appear/Effect.Fade >> >> i would like fade in and out an element on hovering an element(-> >> tooltip behavior), but when i''m using Effect.Appear/Effect.Fade both >> effects will continue to play and overlap each other, resulting in >> unpredictable behavior. >> >> <code> >> <button onmouseover="Effect.Appear(''test_div2'')" >> onmouseout="Effect.Fade(''test_div'')">TRIGGER</button> >> <div id="test_div" style="width: 100px; height: 100px; >> background-color: #FF33CC;">TEST</div> >> </code> >> >> >> So i need some advice how to stop a running effect for an element, so >> i can start the opposite effect. >> >> I also tried to work with Effect.toggle, but this will just add all >> new effects to the end of the queue, instead of stopping the running >> effect and start the intended one immediately. (in my opinion >> Effect.toggle is doing this wrong - if a user clicks a toggle button >> very often, or is hovering a trigger very fast and often the animation >> will go on, and on, and on...) >> >> thanks for your help >> matthias >> >> >> _______________________________________________ >> Rails-spinoffs mailing list >> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >> > > > > > > ___________________________________________________________________________ > Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les > tarifs exceptionnels pour appeler la France et l''international. > Téléchargez sur http://fr.messenger.yahoo.com > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >-- knallgrau new media solutions gmbh pezzlgasse 7, 1190 wien phone: +43 - 1 - 522 76 37 fax: +43 - 1 - 522 76 38 http://www.knallgrau.at/company/weblog
Hi Marco, the problem is, that the image that you use as an indicator for the resize effect starts to drag. so i found two possible solutions: 1) stop the drag event: line 96ff: if (this.options.resize) { this.resizeHandle.onmousedown this.initResize.bindAsEventListener(this); this.resizeHandle.ondragstart = function(evt) {return false;}; } else { Element.hide(this.resizeHandle); } -> this is still not perfect, because i repeatingly see the sand-clock icon, because ie seems to be busy with something. 2) don''t use an image as the indicator. instead you could use a div, with a background-image. btw: very cool script! keep on reporting about your progress. matthias
Thank you Matthias, I''ll give it a try - still wondering why it''s basically working in Firefox?>From: Matthias Platzer <matthias-jvEZf8eMbRz0+o74n3fu+Q@public.gmane.org> >Reply-To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >Subject: Re: [Rails-spinoffs] resizable window/div - some help needed >Date: Mon, 16 Jan 2006 22:08:53 +0100 >MIME-Version: 1.0 >Received: from wrath.rubyonrails.com ([70.84.143.100]) by >bay0-mc12-f5.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Mon, 16 >Jan 2006 13:09:29 -0800 >Received: from 109.70-84-143.reverse.theplanet.com >(localhost.rubyonrails.org [127.0.0.1])by wrath.rubyonrails.com (Postfix) >with ESMTP id 2E6183A091;Mon, 16 Jan 2006 21:08:58 +0000 (GMT) >Received: from smartmx-03.inode.at (smartmx-03.inode.at [213.229.60.35])by >wrath.rubyonrails.com (Postfix) with ESMTP id 9868839F91for ><rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org>;Mon, 16 Jan 2006 21:08:54 +0000 >(GMT) >Received: from [62.99.202.58] (port=34164 helo=[192.168.0.126])by >smartmx-03.inode.at with esmtpa (Exim 4.50) id 1Eybau-0003Og-Erfor >rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org;Mon, 16 Jan 2006 22:08:52 +0100 >X-Message-Info: KtxBqYfPyq1u7TEtrhBN1+8h8qOaosDgwzanosjYVfM>User-Agent: Thunderbird 1.5 (Windows/20051201) >References: <43CC02FB.8020205-jvEZf8eMbRz0+o74n3fu+Q@public.gmane.org> <43CC0477.2010708-Qt13gs6zZMY@public.gmane.org> >X-BeenThere: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >X-Mailman-Version: 2.1.5 >Precedence: list >List-Id: rails-spinoffs.lists.rubyonrails.org >List-Unsubscribe: ><http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs>, ><mailto:rails-spinoffs-request-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org?subject=unsubscribe> >List-Archive: <http://wrath.rubyonrails.org/pipermail/rails-spinoffs> >List-Post: <mailto:rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> >List-Help: ><mailto:rails-spinoffs-request-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org?subject=help> >List-Subscribe: ><http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs>, ><mailto:rails-spinoffs-request-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org?subject=subscribe> >Errors-To: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >Return-Path: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >X-OriginalArrivalTime: 16 Jan 2006 21:09:30.0153 (UTC) >FILETIME=[240E7990:01C61AE1] > > >Hi Marco, > >the problem is, that the image that you use as an indicator for the resize >effect starts to drag. so i found two possible solutions: > >1) stop the drag event: >line 96ff: > >if (this.options.resize) { > this.resizeHandle.onmousedown > this.initResize.bindAsEventListener(this); > this.resizeHandle.ondragstart = function(evt) {return false;}; >} else { > Element.hide(this.resizeHandle); >} > >-> this is still not perfect, because i repeatingly see the sand-clock >icon, because ie seems to be busy with something. > >2) don''t use an image as the indicator. >instead you could use a div, with a background-image. > > >btw: >very cool script! keep on reporting about your progress. > >matthias >_______________________________________________ >Rails-spinoffs mailing list >Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs_________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it''s FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/