[Proto-Scripty] element.observ on classname+id

2010-02-20 Thread Jinsa
Hi everybody! I'm actually working on a script acting on a UL menu with different LI classname. The goal is to react onMouseOver and onClick on each LI click or mouseover differently. The fact is the class is unknown so my script have to check the UL and then observe each LI as elements. Here is

[Proto-Scripty] new Element insert problem

2010-02-20 Thread kstubs
What is wrong with the following, the bad result is the new input elements are not contained by the new div element: Javascript: var div1 = div.insert(new Element('div', { 'class': 'new-section' })); div1.insert(new Element('input', { 'name': 'newsection-name-' + count, 'class': 'newsection-name

Re: [Proto-Scripty] Re: element.observ on classname+id

2010-02-20 Thread agnese camellini
Hi jinsa, i'm not a professional but for what i've been reading yesterday i can say you where is the problem. I mean where to begin. The approach can be pretty different if you are using a framework (Mootools scriptaculous jQuery) or you are writing javascript by yourself (which i think in order

[Proto-Scripty] Re: element.observ on classname+id

2010-02-20 Thread joe t.
Just as a small nit-pick, LI elements are containers, and so should have closing /li tags. -joe t. On Feb 20, 8:58 am, Jinsa jf.wesq...@gmail.com wrote: Hi everybody! I'm actually working on a script acting on a UL menu with different LI classname. The goal is to react onMouseOver and

[Proto-Scripty] Re: new Element insert problem

2010-02-20 Thread T.J. Crowder
Hi, Element#insert returns a reference to the same element you called it on, not the new content. Just change your first line to var div1 = new Element('div', { 'class': 'new-section' }); div.insert(div1); ...and the rest should work. HTH, -- T.J. Crowder Independent Software

[Proto-Scripty] Re: element.observ on classname+id

2010-02-20 Thread T.J. Crowder
Hi Jinsa, Your `bindage` method nearly works, you just have to change `$ ('menu').down('li').each` to `$('menu').select('li').each`. Element#down (with no index argument) finds the first matching descendant element and returns it; Element#select finds all matching descendant elements and returns

[Proto-Scripty] Re: element.observ on classname+id

2010-02-20 Thread T.J. Crowder
Hi Joe, Just as a small nit-pick, LI elements are containers, and so should have closing /li tags. Browser behavior for years has made doing what he did functional, and the HTML5 spec will actually formalize it: http://dev.w3.org/html5/spec/syntax.html#optional-tags I only realized that the

[Proto-Scripty] Re: evalScripts problem

2010-02-20 Thread T.J. Crowder
Hi Dan, NOW, every-time I do a AJAX.UPDATER...it doesn't do what it's suppose to. IN OTHER WORDS: It's acting like those declarations are not declared in the header. It's actually doing what it's documented[1] to do: script blocks referencing external files will be treated as though they were

[Proto-Scripty] Re: change frequency in running periodical executer?

2010-02-20 Thread Радослав Станков
There isn't PeriodicalExecuter#start method its PeriodicalExecuter#registerCallback You can do: code x.stop(); x.frequency = 1; x.registerCallback(); /code You can also do: code PeriodicalExecuter.addMethods({ changeFrequency: function(frequency){ this.stop(); this.frequency = 1;

[Proto-Scripty] Re: element.observ on classname+id

2010-02-20 Thread Радослав Станков
You can also use Event.delegate / http://gist.github.com/66568 / And make it event simpler $('menu').deleage('li', 'click', function(event){ event.stop(); alert('hellow bro'); } -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group.