Try putting:

Event.stop(event);

Inside _srcListClick.

On 7/16/06, Marco M. Jaeger <[EMAIL PROTECTED]> wrote:

 

 

 

Hello,

 

Let's say I have an html markup like this:

 

<ul id="srcList">

        <li><a href="" rel="0|0">link 1</a></li>

        <li><a href="" return false;">link 2</a></li>

        <li><a href="" return false;">link 3</a></li>

        <li><a href="" return false;">link 4</a></li>

      </ul>

 

The eventObserver is on the UL tag – what is the best way to prevent the default execution when a link is clicked;

 

Using #url as the href works as does this: return false;"

 

I was just wondering what the best practice would be.

 

The event observer looks like this:

 

                                    this.eventSrcListClick = this._srcListClick.bindAsEventListener(this);

                                    Event.observe('srcList', 'click', this.eventSrcListClick);

 

And the function looks like this:

 

                        _srcListClick: function(event) {                        

                                    var element = Event.findElement(event, 'A');

                                   

                        },

 

Thank you in advance for your input


_______________________________________________
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

Reply via email to