Re: [Rails-spinoffs] help with syntax
Louis, you'll definitely want to look at Quirksmode: http://www.quirksmode.org/js/ On Feb 3, 2006, at 3:01 PM, Louis Walch wrote: im not a javascript programmer... so be nice. scriptaclous uses a differnt format for writing functions and code then i am used to. are there books or tutorials for helping a beginner understand how to write like this and what everything is? that said... i was readding this webpage: http://particletree.com/features/lightbox-gone-wild/ and had a question about this function: initialize: function(ctrl) { this.content = ctrl.href; Event.observe(ctrl, 'click', this.activate.bindAsEventListener (this), false); ctrl.onclick = function(){return false;}; }, im totally stumped, this along with most of the prototype/scriptaclous functions confuse the crap out of me. is this.contnet all the href tags on the entire page? and is adding an Event.observe to everyone of them? what is ctrl.click, and how does it know to use that? ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
[Rails-spinoffs] Urgently Need Solution
I'm using scriptaculous' SlideUp and SlideDown effects to animate a menu. Specifically, I SlideUp, make some CSS changes, and SlideDown. All works well, except that for a split second in between, the element's display becomes 'none' and the other menu item jump into the space. I haven't been able to find any way to force an element to retain 'display: block' or 'display: inline' after completing an animation like SlideUp or Fade. Any thoughts? -- Yehuda KatzWeb Developer(ph) 718.877.1325(fax) 718.686.4288 ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
RE: [Rails-spinoffs] Urgently Need Solution
You could do: new Effect.SlideUp(element, { to: 0.01 }); That way it’ll only slide up until there is 1% showing, and not completely remove it. Then, on the reverse do: new Effect.SlideDown(element, { from: 0.01 }); Or at least that *should* work. Good luck. Greg From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Yehuda Katz Sent: Monday, February 06, 2006 11:28 AM To: rails-spinoffs@lists.rubyonrails.org Subject: [Rails-spinoffs] Urgently Need Solution I'm using scriptaculous' SlideUp and SlideDown effects to animate a menu. Specifically, I SlideUp, make some CSS changes, and SlideDown. All works well, except that for a split second in between, the element's display becomes 'none' and the other menu item jump into the space. I haven't been able to find any way to force an element to retain 'display: block' or 'display: inline' after completing an animation like SlideUp or Fade. Any thoughts? -- Yehuda Katz Web Developer (ph) 718.877.1325 (fax) 718.686.4288 ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
[Rails-spinoffs] Parameters to Event Handler Function
I need a way to pass parameters to an event handler function other than just the e.I'm declaring the handler as such: Event.observe('regmenu', 'mouseover', togglein, false);I need a way to pass parameters to the togglein function. I'm getting tripped up by the fact that the event object is getting automatically passed. -- Yehuda KatzWeb Developer(ph) 718.877.1325(fax) 718.686.4288 ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Re: [Rails-spinoffs] Urgently Need Solution
Using to: x doesn't work. The element still disappears after it reaches its desired destination.On 2/6/06, Gregory Hill < [EMAIL PROTECTED]> wrote: You could do: new Effect.SlideUp(element, { to: 0.01 }); That way it'll only slide up until there is 1% showing, and not completely remove it. Then, on the reverse do: new Effect.SlideDown(element, { from: 0.01 }); Or at least that *should* work. Good luck. Greg From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Yehuda Katz Sent: Monday, February 06, 2006 11:28 AM To: rails-spinoffs@lists.rubyonrails.org Subject: [Rails-spinoffs] Urgently Need Solution I'm using scriptaculous' SlideUp and SlideDown effects to animate a menu. Specifically, I SlideUp, make some CSS changes, and SlideDown. All works well, except that for a split second in between, the element's display becomes 'none' and the other menu item jump into the space. I haven't been able to find any way to force an element to retain 'display: block' or 'display: inline' after completing an animation like SlideUp or Fade. Any thoughts? -- Yehuda Katz Web Developer (ph) 718.877.1325 (fax) 718.686.4288 ___Rails-spinoffs mailing listRails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs -- Yehuda KatzWeb Developer(ph) 718.877.1325(fax) 718.686.4288 ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Re: [Rails-spinoffs] Parameters to Event Handler Function
On Monday 06 February 2006 13:05, Yehuda Katz wrote: > I need a way to pass parameters to an event handler function other than > just the e. > I'm declaring the handler as such: Event.observe('regmenu', 'mouseover', > togglein, false); What you're looking for is a closure :) Event.observe('regmenu', 'mouseover', function(e) { togglein(e, param1, param2, param3, etc); }, false); where 'e' is the event object for the particular triggered event. -Jeremy -- Jeremy Kitchen ++ [EMAIL PROTECTED] In the beginning was The Word and The Word was Content-type: text/plain -- The Word of Bob. pgpJ6yCc3sVrz.pgp Description: PGP signature ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Re: [Rails-spinoffs] Urgently Need Solution
It seems to be a side-effect of the makeClipping commend in Effect.BlindDown. When I comment it out, I no longer have the problem, but I do need the clipping behavior. Any thoughts?On 2/6/06, Yehuda Katz <[EMAIL PROTECTED]> wrote: Using to: x doesn't work. The element still disappears after it reaches its desired destination.On 2/6/06, Gregory Hill < [EMAIL PROTECTED]> wrote: You could do: new Effect.SlideUp(element, { to: 0.01 }); That way it'll only slide up until there is 1% showing, and not completely remove it. Then, on the reverse do: new Effect.SlideDown(element, { from: 0.01 }); Or at least that *should* work. Good luck. Greg From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Yehuda Katz Sent: Monday, February 06, 2006 11:28 AM To: rails-spinoffs@lists.rubyonrails.org Subject: [Rails-spinoffs] Urgently Need Solution I'm using scriptaculous' SlideUp and SlideDown effects to animate a menu. Specifically, I SlideUp, make some CSS changes, and SlideDown. All works well, except that for a split second in between, the element's display becomes 'none' and the other menu item jump into the space. I haven't been able to find any way to force an element to retain 'display: block' or 'display: inline' after completing an animation like SlideUp or Fade. Any thoughts? -- Yehuda Katz Web Developer (ph) 718.877.1325 (fax) 718.686.4288 ___Rails-spinoffs mailing listRails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs -- Yehuda KatzWeb Developer(ph) 718.877.1325(fax) 718.686.4288 -- Yehuda KatzWeb Developer(ph) 718.877.1325(fax) 718.686.4288 ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Re: [Rails-spinoffs] Urgently Need Solution
After further experimentation, it seems I needed to have the parameter: {to: 0.99}, not {to: 0.01}On 2/6/06, Yehuda Katz < [EMAIL PROTECTED]> wrote:It seems to be a side-effect of the makeClipping commend in Effect.BlindDown. When I comment it out, I no longer have the problem, but I do need the clipping behavior. Any thoughts?On 2/6/06, Yehuda Katz <[EMAIL PROTECTED]> wrote: Using to: x doesn't work. The element still disappears after it reaches its desired destination.On 2/6/06, Gregory Hill < [EMAIL PROTECTED]> wrote: You could do: new Effect.SlideUp(element, { to: 0.01 }); That way it'll only slide up until there is 1% showing, and not completely remove it. Then, on the reverse do: new Effect.SlideDown(element, { from: 0.01 }); Or at least that *should* work. Good luck. Greg From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Yehuda Katz Sent: Monday, February 06, 2006 11:28 AM To: rails-spinoffs@lists.rubyonrails.org Subject: [Rails-spinoffs] Urgently Need Solution I'm using scriptaculous' SlideUp and SlideDown effects to animate a menu. Specifically, I SlideUp, make some CSS changes, and SlideDown. All works well, except that for a split second in between, the element's display becomes 'none' and the other menu item jump into the space. I haven't been able to find any way to force an element to retain 'display: block' or 'display: inline' after completing an animation like SlideUp or Fade. Any thoughts? -- Yehuda Katz Web Developer (ph) 718.877.1325 (fax) 718.686.4288 ___Rails-spinoffs mailing listRails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs -- Yehuda KatzWeb Developer(ph) 718.877.1325(fax) 718.686.4288 -- Yehuda KatzWeb Developer(ph) 718.877.1325(fax) 718.686.4288 -- Yehuda KatzWeb Developer(ph) 718.877.1325(fax) 718.686.4288 ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
RE: [Rails-spinoffs] Urgently Need Solution
That’s interesting. I just assumed it would be the reverse for effects that make an element disappear. I believe Effect.Fade works that way, but maybe I’m just smoking something. Anyhoo, good to know. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Yehuda Katz Sent: Monday, February 06, 2006 2:58 PM To: rails-spinoffs@lists.rubyonrails.org Subject: Re: [Rails-spinoffs] Urgently Need Solution After further experimentation, it seems I needed to have the parameter: {to: 0.99}, not {to: 0.01} On 2/6/06, Yehuda Katz < [EMAIL PROTECTED]> wrote: It seems to be a side-effect of the makeClipping commend in Effect.BlindDown. When I comment it out, I no longer have the problem, but I do need the clipping behavior. Any thoughts? ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Re: [Rails-spinoffs] Urgently Need Solution
One more question for today: How do I trigger a function after an effect has completed?On 2/6/06, Gregory Hill < [EMAIL PROTECTED]> wrote: That's interesting. I just assumed it would be the reverse for effects that make an element disappear. I believe Effect.Fade works that way, but maybe I'm just smoking something. Anyhoo, good to know. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Yehuda Katz Sent: Monday, February 06, 2006 2:58 PM To: rails-spinoffs@lists.rubyonrails.org Subject: Re: [Rails-spinoffs] Urgently Need Solution After further experimentation, it seems I needed to have the parameter: {to: 0.99}, not {to: 0.01} On 2/6/06, Yehuda Katz < [EMAIL PROTECTED]> wrote: It seems to be a side-effect of the makeClipping commend in Effect.BlindDown. When I comment it out, I no longer have the problem, but I do need the clipping behavior. Any thoughts? ___Rails-spinoffs mailing listRails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs -- Yehuda KatzWeb Developer(ph) 718.877.1325(fax) 718.686.4288 ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
RE: [Rails-spinoffs] Urgently Need Solution
http://wiki.script.aculo.us/scriptaculous/show/CoreEffects The documentation has a list of callback functions available to all effects. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Yehuda Katz Sent: Monday, February 06, 2006 3:07 PM To: rails-spinoffs@lists.rubyonrails.org Subject: Re: [Rails-spinoffs] Urgently Need Solution One more question for today: How do I trigger a function after an effect has completed? On 2/6/06, Gregory Hill < [EMAIL PROTECTED]> wrote: That's interesting. I just assumed it would be the reverse for effects that make an element disappear. I believe Effect.Fade works that way, but maybe I'm just smoking something. Anyhoo, good to know. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Yehuda Katz Sent: Monday, February 06, 2006 2:58 PM To: rails-spinoffs@lists.rubyonrails.org Subject: Re: [Rails-spinoffs] Urgently Need Solution After further experimentation, it seems I needed to have the parameter: {to: 0.99}, not {to: 0.01} On 2/6/06, Yehuda Katz < [EMAIL PROTECTED]> wrote: It seems to be a side-effect of the makeClipping commend in Effect.BlindDown. When I comment it out, I no longer have the problem, but I do need the clipping behavior. Any thoughts? ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs -- Yehuda Katz Web Developer (ph) 718.877.1325 (fax) 718.686.4288 ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Re: [Rails-spinoffs] Urgently Need Solution
I've been able to do it with: the option afterFinishInternal.On 2/6/06, Yehuda Katz <[EMAIL PROTECTED]> wrote: One more question for today: How do I trigger a function after an effect has completed?On 2/6/06, Gregory Hill < [EMAIL PROTECTED]> wrote: That's interesting. I just assumed it would be the reverse for effects that make an element disappear. I believe Effect.Fade works that way, but maybe I'm just smoking something. Anyhoo, good to know. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Yehuda Katz Sent: Monday, February 06, 2006 2:58 PM To: rails-spinoffs@lists.rubyonrails.org Subject: Re: [Rails-spinoffs] Urgently Need Solution After further experimentation, it seems I needed to have the parameter: {to: 0.99}, not {to: 0.01} On 2/6/06, Yehuda Katz < [EMAIL PROTECTED]> wrote: It seems to be a side-effect of the makeClipping commend in Effect.BlindDown. When I comment it out, I no longer have the problem, but I do need the clipping behavior. Any thoughts? ___Rails-spinoffs mailing listRails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs -- Yehuda KatzWeb Developer(ph) 718.877.1325(fax) 718.686.4288 -- Yehuda KatzWeb Developer(ph) 718.877.1325(fax) 718.686.4288 ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
RE: [Rails-spinoffs] Urgently Need Solution
Um, afterFinishInternal or anything else marked ‘internal’ is something you generally don’t want to mess with, as it means it’s internal to the class. afterFinish is the proper option you are looking for, which is listed on the page I sent. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Yehuda Katz Sent: Monday, February 06, 2006 3:19 PM To: rails-spinoffs@lists.rubyonrails.org Subject: Re: [Rails-spinoffs] Urgently Need Solution I've been able to do it with: the option afterFinishInternal. On 2/6/06, Yehuda Katz <[EMAIL PROTECTED]> wrote: One more question for today: How do I trigger a function after an effect has completed? On 2/6/06, Gregory Hill < [EMAIL PROTECTED]> wrote: That's interesting. I just assumed it would be the reverse for effects that make an element disappear. I believe Effect.Fade works that way, but maybe I'm just smoking something. Anyhoo, good to know. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Yehuda Katz Sent: Monday, February 06, 2006 2:58 PM To: rails-spinoffs@lists.rubyonrails.org Subject: Re: [Rails-spinoffs] Urgently Need Solution After further experimentation, it seems I needed to have the parameter: {to: 0.99}, not {to: 0.01} On 2/6/06, Yehuda Katz < [EMAIL PROTECTED]> wrote: It seems to be a side-effect of the makeClipping commend in Effect.BlindDown. When I comment it out, I no longer have the problem, but I do need the clipping behavior. Any thoughts? ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs -- Yehuda Katz Web Developer (ph) 718.877.1325 (fax) 718.686.4288 -- Yehuda Katz Web Developer (ph) 718.877.1325 (fax) 718.686.4288 ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
[Rails-spinoffs] Notify JS updates, oh my
Hey all, I just wanted to let you guys know that I updated my notify script. I still need to package it for easy download (next on my task list) but it does what I need it to do. Any thoughts, comments? http://thinkof.net/notify/index.html Also thanks to those of you who helped previously. -Greg ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Re: [Rails-spinoffs] Urgently Need Solution
Yup. I noticed that after I sent it. The internal version worked, but you're right.On 2/6/06, Gregory Hill <[EMAIL PROTECTED] > wrote: Um, afterFinishInternal or anything else marked 'internal' is something you generally don't want to mess with, as it means it's internal to the class. afterFinish is the proper option you are looking for, which is listed on the page I sent. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Yehuda Katz Sent: Monday, February 06, 2006 3:19 PM To: rails-spinoffs@lists.rubyonrails.org Subject: Re: [Rails-spinoffs] Urgently Need Solution I've been able to do it with: the option afterFinishInternal. On 2/6/06, Yehuda Katz <[EMAIL PROTECTED]> wrote: One more question for today: How do I trigger a function after an effect has completed? On 2/6/06, Gregory Hill < [EMAIL PROTECTED]> wrote: That's interesting. I just assumed it would be the reverse for effects that make an element disappear. I believe Effect.Fade works that way, but maybe I'm just smoking something. Anyhoo, good to know. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Yehuda Katz Sent: Monday, February 06, 2006 2:58 PM To: rails-spinoffs@lists.rubyonrails.org Subject: Re: [Rails-spinoffs] Urgently Need Solution After further experimentation, it seems I needed to have the parameter: {to: 0.99}, not {to: 0.01} On 2/6/06, Yehuda Katz < [EMAIL PROTECTED]> wrote: It seems to be a side-effect of the makeClipping commend in Effect.BlindDown. When I comment it out, I no longer have the problem, but I do need the clipping behavior. Any thoughts? ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs -- Yehuda Katz Web Developer (ph) 718.877.1325 (fax) 718.686.4288 -- Yehuda Katz Web Developer (ph) 718.877.1325 (fax) 718.686.4288 ___Rails-spinoffs mailing listRails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs -- Yehuda KatzWeb Developer(ph) 718.877.1325(fax) 718.686.4288 ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
[Rails-spinoffs] onHover: can u explain me this function ?
In Sortables, we have a function onHover: onHover: function(element, dropon, overlap) { if(overlap>0.5) { Sortable.mark(dropon, 'before'); if(dropon.previousSibling != element) { var oldParentNode = element.parentNode; element.style.visibility = "hidden"; // fix gecko rendering dropon.parentNode.insertBefore(element, dropon); if(dropon.parentNode!=oldParentNode) Sortable.options(oldParentNode).onChange(element); Sortable.options(dropon.parentNode).onChange(element); } } else { Sortable.mark(dropon, 'after'); var nextElement = dropon.nextSibling || null; if(nextElement != element) { var oldParentNode = element.parentNode; element.style.visibility = "hidden"; // fix gecko rendering dropon.parentNode.insertBefore(element, nextElement); if(dropon.parentNode!=oldParentNode) Sortable.options(oldParentNode).onChange(element); Sortable.options(dropon.parentNode).onChange(element); } } }, I was not able to understand what go these lines of code do? Cos onChange is onChange: Prototype.emptyFunction, And the emptyFunction is emptyFunction: function() {}, So I’m kinda lost, can anyone help me understand the same? Thanks in advance Regards Varun Mehta *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* imagination is more important than knowledge – albert einstein *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* Visit Varun at http://varun.cjb.net [HTML] http://varuninfo.cjb.net [Blogged] http://varunmehta.cjb.net [Flash] ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs