0

我有一个 jqModal 对话框:

function initOrderIdCardDialog() {
    $('#orderIdCardDialog').jqm({
        trigger: '#orderIdCardButton',
        overlay: 85, /* 0-100 (int) : 0 is off/transparent, 100 is opaque */
        overlayClass: 'dialogOverlay',
        closeClass:'cancelOrderIDCard',
        onShow: showDialog,
        onHide: hideDialog,
        toTop: true
    });
}

在一些 html 之后调用:

<a href="#" class="sideBtn" id="orderIdCardButton">Order ID Card</a>
...
<div id="orderIdCardDialog" class="dialog">
    ...
</div>
<script type="text/javascript" charset="utf-8">
    initOrderIdCardDialog();
</script>

当页面加载时,jqModal.js 中会抛出异常:

Uncaught TypeError: undefined is not a function

在 jqModal.js 的第 34 行,紧随其后:

$.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow');};

因此,单击链接不会显示对话框。如果我将 jQuery 选择器替换为触发器的空字符串,则不会引发异常。我有点困惑,因为jqModal 的网站说 jQuery 选择器是有效的。任何帮助将不胜感激。谢谢你。

4

1 回答 1

0

每个anpsmn

jQuery 的版本是多少?它不适用于 1.9+。见小提琴。在小提琴中将其更改为 1.8.3 即可。

于 2013-04-20T21:17:16.573 回答