使用 inArray 时如何获取匹配数组值的索引?
我目前有这个!
startHere = 0
var slides = new Array();
slides[0] = "home";
slides[1] = "about";
slides[2] = "working";
slides[3] = "services";
slides[4] = "who";
slides[5] = "new";
slides[6] = "contact";
if( window.location.hash != '' ) {
anchor = window.location.hash;
if( $.inArray(anchor, slides) ) {
startHere = key;
}
}
提前感谢您的任何建议,K...