$layer is not a function 怎么解决

2025-05-20 11:53:28
推荐回答(3个)
回答(1):

这是已经老版的layer插件的引用方式了,新版的一般是layer.open,这个问题是因为js引用的顺序问题,需要把jQuery.js的引用放到layer.js的前面

回答(2):



function showClientDialog() {
$.layer({
type: 2,
title: ["选择产品", true],
fix: true,
move: false,
maxmin: true,
shadeClose: false,
shade: [0.3, '#000', true],
border: [5, 0.3, '#666', true],
offset: [($(window).height() - 480) / 2 + 'px', ''],
area: [1000 + 'px', 480 + 'px'],
iframe: { src: "../WarehouseManager/CheProduct.aspx" }

});
}

回答(3):

因为没有引入jq,所以会报这个错!!亲测