开发者

Element prototype exceptions (not a function or method)

开发者 https://www.devze.com 2023-02-01 15:31 出处:网络
whatever i append to $(\'click_filter1\') it shows the error ... is not a function (for show(), hide(), toggle())

whatever i append to $('click_filter1') it shows the error ... is not a function (for show(), hide(), toggle())

if i insert an alert, the alert gets executed, so the framework is init ok

the element with the id exists 开发者_如何学Cfor sure

what can be the problem of this? why iam getting this error?

    $('click_filter1').addEvent('click', function() {
        $('click_filter1').show();
    }.bind(this));


First of all, your title is misleading and not descriptive enough.

Secondly, toggle, show, hide for Element is only available when you include Element.Shortcuts from MooTools-more - be sure to do that, and the code will work as expected.

Working example: http://www.jsfiddle.net/UjF2y/

0

精彩评论

暂无评论...
验证码 换一张
取 消