说我有以下功能:jQuery的 - 从函数返回一个值
function checkPanes() {
activePane = '';
var panels = $("#slider .box .panel");
panels.each(function() {
//find the one in visible state.
if ($(this).is(":visible")) {
activePane = $(this).index()+1;
console.log(activePane);
}
});
} //END checkPanes();
理想情况下,我想在这个函数调用别处(最有可能从另一个功能), 和检索价值我目前正在输出到控制台。
(例如..)
function exampleCase() {
checkPanes(); //evidently, does not return anything.
//Ideally, I want the numerical value, being output to console in above function.
}
提前感谢!所有的建议/意见非常感谢。
干杯
你试过'返回activePane;'? – Sampson 2011-05-16 15:48:19