jQuery accordion active: not working in Firefox using ID tag
In IE, Chrome, Safari & Opera this works:
<a id=开发者_C百科"VY" class="menu-title">Very Young</a>
$("#accordion").accordion({
autoHeight: false,
collapsible: true,
header: '.menu-title',
navigation: true,
event: 'click',
active: VY,
animated: 'easeslide'
});
My accordion menu opens at the 'Very Young' link id="VY"
But in Firefox it doesn't, it displays the menu with all items open. Is it possible to get Firefox to display it like the others or is there a JavaScript/jQuery method to get the index of the item with an id of e.g. 'VY' which is what enables it to open the menu at the appropriate place e.g. active: 3.
Unless you have defined the VY
variable previously in JavaScript but didn't post it in your example, then that's probably your problem. The accorion's active property expects an element or selector (or a few other things--see docs for complete list). Instead of active: VY
use:
$("#accordion").accordion({
autoHeight: false,
collapsible: true,
header: '.menu-title',
navigation: true,
event: 'click',
active: '#VY',
animated: 'easeslide'
});
精彩评论