0

我有 JS 代码,jqxWindow它只工作一次:

$(document).ready(function () {
    $("#jqxwindow1 ").jqxWindow({ height: 800, width: 1212, maxWidth: 1600, maxHeight: 900, animationType: 'none', theme: 'fresh', autoOpen: false  });
    $("#jqxwindow2 ").jqxWindow({ height: 800, width: 1212, maxWidth: 1600, maxHeight: 900, animationType: 'none', theme: 'fresh', autoOpen: false  });
    $("#jqxwindow3 ").jqxWindow({ height: 800, width: 1212, maxWidth: 1600, maxHeight: 900, animationType: 'none', theme: 'fresh', autoOpen: false  });
    $("#jqxwindow4 ").jqxWindow({ height: 800, width: 1212, maxWidth: 1600, maxHeight: 900, animationType: 'none', theme: 'fresh', autoOpen: false  });
    $("#jqxwindow5 ").jqxWindow({ height: 800, width: 1212, maxWidth: 1600, maxHeight: 900, animationType: 'none', theme: 'fresh', autoOpen: false  });

$('div[id^="test"] p').click(function() {
    var string = "#jqxwindow" + $(this).text().split('|')[0];
    //alert("The window is opened : " + string);
    var opened = $(string).jqxWindow('isOpen');
    var action = 'close';
    if (opened == false)
        action = 'open';
        $(string).jqxWindow(action);
        $(string).jqxWindow('bringToFront');
    });
});

我正在搜索,但每个解决方案都不适用于我。

乐:

未捕获的 TypeError: $(...).jqxWindow 不是函数

在线的

var opened = $(string).jqxWindow('isOpen');
4

1 回答 1

0

我解决了:在(文档)jQuery 之前和函数中放置参数 $. 前任。下:

         jQuery(document).ready(function ($) {
//function code
    }

现在它的工作。

于 2015-05-26T10:42:21.610 回答