我是jQuery的新手。您能否在回发后提供维护手风琴菜单(在母版页中)的完整代码。如何在我的应用程序中使用以下代码?
我有一个母版页和一些内容页面。单击母版页中的链接时,总菜单将折叠。但我需要打开最后一个菜单点击。
let viewWidth = self.view.frame.size.width
var navBar: UINavigationBar = UINavigationBar(frame: CGRect(x:0, y:20, width: viewWidth, height:44))
navBar.barTintColor = UIColor .lightGrayColor()
navBar.delegate = self
self.view.addSubview(navBar)
答案 0 :(得分:0)
尝试FIDDLE,
$(function() {
$("#accordion").accordion({ // initialising the accordian
activate: function(event, ui) {
var index = $("#accordion").accordion("option", "active"); // Getting the current Opened/Active Tab index value (Starting from Zero 0)
$('#hidAccordionIndex').val(index); // Setting Active tab value to Hidden Field
}
});
$("#accordion").accordion("option", "active", parseInt($('#hidAccordionIndex').val(), 10)); // Setting Active Tab value to Accordian
});
希望它有所帮助...