简体   繁体   English

切换div和Mootools-相同的脚本和样式,但效果不同

[英]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. 通常,我为主题编写了mootools脚本,该脚本在某些div上可以正常工作。 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). 登录时(用户:demo,密码:demo),在消息下方,您将看到按钮: Who Said Thank You附件和非常长的按钮COM_KUNENA_BUTTON_QUICK_REPLY_reply (名称并不重要,只是缺少lang字符串)。

So when you click on Who Said Thank You or Attachments buttons, hidden div will appear (or close). 因此,当您单击“ 谁说谢谢”或“ 附件”按钮时,将显示(或关闭)隐藏的div。 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. 按钮以触发脚本的类包装在div中。 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) 我检查了FIDDLE我的网站上使用的div中仅包含脚本的一部分),但无法完美地再现问题)

please help 请帮忙

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. 并删除html中的onClick="return false; .style.display = 'block'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM