我有填充,隐藏和显示基于它是否包含一个ID的一部分div的脚本,然后显示,包含完整的DIV不工作,唯一的ID传递给函数。功能如下:jQuery的隐藏与attributesStartsWith预期
function showPlot(plotId) {
// Hide all plots by switching them to a class
$('div[id^="plot_"').hide(); //<--Won't hide the divs matching that portion of the Id
// Show the selected plot by changing it's class
$('#' + plotId).show('fast');
}
的问题是.hide()函数不会隐藏指定的div预期。我可能没有正确的语法,但我非常肯定根据API是正确的。还有什么我失踪?帮助表示赞赏。
是函数正确调用? –