2016-11-02 12:12:53 +08:00
|
|
|
|
$(function () {
|
2016-11-19 17:45:36 +08:00
|
|
|
|
if ($.browser.versions.ios) $('#content').css({ 'overflow': 'auto', '-webkit-overflow-scrolling': 'touch' });
|
|
|
|
|
function setActive(ele) {
|
|
|
|
|
ele.addClass('active');
|
|
|
|
|
ele.parents("ul").first().find('p').addClass('active');
|
|
|
|
|
var breadcrumb = ele.text();
|
|
|
|
|
if (breadcrumb === "") $breadNav.hide();
|
|
|
|
|
else $breadNav.text(breadcrumb);
|
2016-11-02 12:12:53 +08:00
|
|
|
|
}
|
2016-11-19 17:45:36 +08:00
|
|
|
|
$('#navbar').attr('data-toggle', "dropdown").addClass('dropdown-toggle');
|
2016-11-19 13:07:34 +08:00
|
|
|
|
var $subMenu = $('#submenu');
|
2016-11-19 15:16:58 +08:00
|
|
|
|
var $breadNav = $('#breadNav');
|
2016-11-19 13:07:34 +08:00
|
|
|
|
$subMenu.on('click', 'a', function (event) {
|
|
|
|
|
var $this = $(this);
|
|
|
|
|
var act = $this.attr("data-act");
|
2016-11-06 12:28:53 +08:00
|
|
|
|
if (act === "True") return true;
|
2016-11-05 23:15:07 +08:00
|
|
|
|
event.preventDefault();
|
2016-11-19 13:07:34 +08:00
|
|
|
|
$subMenu.find('p, a').removeClass('active');
|
|
|
|
|
setActive($this);
|
|
|
|
|
$('iframe').attr('src', $this.attr('href'));
|
|
|
|
|
});
|
|
|
|
|
$subMenu.find('a').each(function (index, ele) {
|
|
|
|
|
var $this = $(this);
|
|
|
|
|
if ($this.attr('href') == window.location.pathname) setActive($this);
|
2016-11-05 23:15:07 +08:00
|
|
|
|
});
|
2016-11-01 20:14:27 +08:00
|
|
|
|
});
|