Ireek
Ireek

Reputation: 45

Toggle divs and Mootools - same script and style but different effect

I'm stuck probably with easy thing, but spent two days without finding any solution. Generaly I have mootools script writen for my theme, which works fine with some divs. HERE is the link to problem.

When you logged in (user:demo, pass:demo) you will see, under the message, buttons: Who Said Thank You, Attachments and very long button COM_KUNENA_BUTTON_QUICK_REPLY_reply (the name is not important, just missed lang strings).

So when you click on Who Said Thank You or Attachments buttons, hidden div will appear (or close). The same should happen with the long button and show Quick Reply form below the message (which is already displayed). And here is the thing I don't know how to fix. Buttons are wrapped in div with class that trigger the script. Unfortunately one is working incorrectly.

I checked FIDDLE (only part of script included with divs used on my website) and can't reproduce the problem as works perfectly)

please help

Upvotes: 1

Views: 172

Answers (1)

Sergio
Sergio

Reputation: 28845

You can use this:

document.getElements('a[data-target^="#quick-reply"]').addEvent('click', function(ev){ 
    ev.preventDefault(); 
    this.reveal(); 
});

And remove the onClick="return false; .style.display = 'block' inside the html.

Upvotes: 1

Related Questions