我有jqxWindow
的JS代码,只能运行一次:
$(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');
});
});
我在搜索,但每个解决方案都不适合我。
LE
未捕获的TypeError:$(...)。jqxWindow不是函数
在线
var opened = $(string).jqxWindow('isOpen');
答案 0 :(得分:0)
我解决了: 刚刚放入(文档)jQuery并在函数中放入参数$。恩。下:
jQuery(document).ready(function ($) {
//function code
}
现在它已经发挥作用了。