[Moo] Re: Multiple events applied

2009-04-14 Thread nutron
There is no method Element.remove(). Only Element.dispose() (which removes it from the DOM, but it can be injected again later; it still exists) and Element.destroy() which removes it from memory entirely. The destroy method obviously removes any events attached to it. On Tue, Apr 14, 2009 at 6:3

[Moo] Re: Question about .getElementById()

2009-04-14 Thread Gzool
secondListNode.getElementById("title"), it find the element not in secondListNode but in secondListNode.ownDocument, you can see Mootools' code. In you example, secondListNode.ownDocument is the same as document, but in one page, id can't be reduplicated, so it will return null. In mootools' tutor

[Moo] Re: Multiple events applied

2009-04-14 Thread Steve Onnis
remove() only removes the element but the events stay in memory so before you call remove() call removeEvents() also on the element -Original Message- From: mootools-users@googlegroups.com [mailto:mootools-us...@googlegroups.com] On Behalf Of electronbender Sent: Wednesday, 15 April 2009

[Moo] enableClass

2009-04-14 Thread Mike
Can I propose a new method of called enableClass? Makes certain code much more compact. ... .. enableClass: function(className, isEnabled) { (isEnabled) ? this.addClass(className) : this.removeClass (className); }, ... ..

[Moo] Re: Question about .getElementById()

2009-04-14 Thread Mike
Thanks all for the replies. I think you are right. Probably safer to use selectors. I guess it would be possible to iterate through all of the children of the containing node to find the first node with that id but I guess that's quite expensive. On Apr 15, 12:12 am, keif wrote: > Dimitar:

[Moo] multibox, ie6 and select boxes

2009-04-14 Thread keif
So I've been using a ported version of phatfusion's multibox with the overlay script. http://phatfusion.net/multibox/ Only issue is, the overlay isn't overlaying IE6 select boxes. The overlay code was barely touched (if at all) in conversion to 1.2, as the multibox iframe (the one with the conte

[Moo] Re: Drag.Move() slow for images

2009-04-14 Thread nwhite
I'm not sure how your using Drag.Move but I would recommend giving Scroller a try. Harald has this page http://digitarald.de/playground/fly-over-background/ it would probably take some work but should give you a good starting point. A while back I did some testing using background-position but foun

[Moo] Drag.Move() slow for images

2009-04-14 Thread TheIvIaxx
I'm not sure if this is a limitation of the browser or how mootools is handling the drag. I have it setup so there is a large image, 2048x1536, that loads and is inside a window. Sort of like a popup image viewer for large images. Anyway, when panning the image around, its very slow. the viewa

[Moo] Re: JSON shuffle. How?

2009-04-14 Thread Iain
I'm assuming you're getting this data from a database, why not shuffle it in the query? mysql example: "SELECT * FROM products ORDER BY RAND()" On Apr 12, 9:00 am, Rolf wrote: > I don't want a random item, but I want to shuffle the order. > I loop through the whole thing and show it as thumbnail

[Moo] Re: Multiple events applied

2009-04-14 Thread electronbender
Ok, what i've done is do a removeEvents before setting the event, so that appears to work. On Apr 14, 4:52 pm, Thierry bela nanga wrote: > I think remove does the same as dispose, > it remove the element from the DOM. > > 2009/4/14 Fábio Costa > > > > > remove sould be equal to dispose. > > Isn

[Moo] Re: checkbox and set("checked","checked");

2009-04-14 Thread Iain
its set( 'checked', true / false ) in regular javascript you would do myelement.checked = true / false; On Apr 10, 2:56 am, snillo wrote: > Hi all, > > has someone an idea why this code doesn't work? is this a bug? > > var test = new Element("input", { >     "type": "checkbox", >     "events":

[Moo] Re: Multiple events applied

2009-04-14 Thread Thierry bela nanga
I think remove does the same as dispose, it remove the element from the DOM. 2009/4/14 Fábio Costa > remove sould be equal to dispose. > Isn't it? > > > Fábio Miranda Costa > Engenheiro de Computação > http://meiocodigo.com > > > On Tue, Apr 14, 2009 at 11:45 AM, electronbender < > ognen.plavev.

[Moo] Re: Multiple events applied

2009-04-14 Thread Fábio Costa
remove sould be equal to dispose. Isn't it? Fábio Miranda Costa Engenheiro de Computação http://meiocodigo.com On Tue, Apr 14, 2009 at 11:45 AM, electronbender wrote: > > No dispose in 1.11 :( > > On Apr 14, 4:44 pm, Fábio Costa wrote: > > Don't know moo 1.1 :S > > But looks like a dispose, s

[Moo] Re: Multiple events applied

2009-04-14 Thread electronbender
No dispose in 1.11 :( On Apr 14, 4:44 pm, Fábio Costa wrote: > Don't know moo 1.1 :S > But looks like a dispose, so maybe i've helped. > > Fábio Miranda Costa > Engenheiro de Computaçãohttp://meiocodigo.com > > On Tue, Apr 14, 2009 at 11:42 AM, electronbender > wrote: > > > > > Using moo 1.11..

[Moo] Re: Multiple events applied

2009-04-14 Thread Fábio Costa
Don't know moo 1.1 :S But looks like a dispose, so maybe i've helped. Fábio Miranda Costa Engenheiro de Computação http://meiocodigo.com On Tue, Apr 14, 2009 at 11:42 AM, electronbender wrote: > > Using moo 1.11.. > I just checked and i do a .remove() on the parent div. > > On Apr 14, 4:16 pm,

[Moo] Re: Multiple events applied

2009-04-14 Thread electronbender
Using moo 1.11.. I just checked and i do a .remove() on the parent div. On Apr 14, 4:16 pm, Fábio Costa wrote: > Are you destroying or disposing the element? > There are 2 methods to remove elements from the DOM, destroy() and > dispose(). > destroy() removes the element from the DOM and really

[Moo] Re: Multiple events applied

2009-04-14 Thread Fábio Costa
Are you destroying or disposing the element? There are 2 methods to remove elements from the DOM, destroy() and dispose(). destroy() removes the element from the DOM and really destroy it and its references and, i think, everything related to it (events included). dispose() removes the element from

[Moo] Re: Question about .getElementById()

2009-04-14 Thread keif
Dimitar: You're right to an extent. For example, if you have: $('description') in IE will grab the meta tag. -kb On Apr 14, 6:31 am, Dimitar Christoff wrote: > > I am not sure if (1) is a big deal since they are treated as strings. i > > oh, i thought it mattered for IE, the rule of thumb

[Moo] Multiple events applied

2009-04-14 Thread electronbender
I create a dropdown, and add a change event to it. Then i destroy the element. After a while i recreate it (same id, same name), and add the same change event to it. However, when i actually fire the change event this time around, it is fired twice! So, every time i delete, re-create it, and ad

[Moo] Re: Question about .getElementById()

2009-04-14 Thread Fábio Costa
id="length" won't work either, because of that node mapping, it will bug. document.forms[0].length ?!?! got it? Fábio Miranda Costa Engenheiro de Computação http://meiocodigo.com On Tue, Apr 14, 2009 at 7:31 AM, Dimitar Christoff wrote: > > > I am not sure if (1) is a big deal since they ar

[Moo] Events with proper timing

2009-04-14 Thread Robert
Hello, I wonder if there is a simple way to start different methods depending on how much time passed between events. example: I have two textareas on a form. I added some functionality to the 'keydown' event. $$('textarea').each(function(item) { item.addEvent('keydown

[Moo] Re: Question about .getElementById()

2009-04-14 Thread Dimitar Christoff
> I am not sure if (1) is a big deal since they are treated as strings. i oh, i thought it mattered for IE, the rule of thumb is to steer clear of ids like name, description, title etc. for instance, in a doc with a , document.getElementById("description") won't reference the textarea in IE, i

[Moo] Control slideshow2 from slimbox Revisited

2009-04-14 Thread Daiv Mowbray
Hello mootoolers, I've been trying to resolve this on and off for some time now. Any pointers would be greatly appreciated. I start the slideshow with this inside of a : window.addEvent('domready', function() {... var ssShow".$this->show_id." = new Slideshow(this.el, null,{. I start the s