修改BUG:iOS小屏设备竖屏时打开侧边栏菜单,后背景过长导致菜单无法完全遮盖住背景内容
This commit is contained in:
parent
ff7517cfd2
commit
a845699333
|
@ -26,6 +26,10 @@
|
|||
margin-left: 0;
|
||||
}
|
||||
|
||||
#main-content.open {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.modal-dialog {
|
||||
width: 540px;
|
||||
margin: 20px auto;
|
||||
|
|
|
@ -131,13 +131,9 @@
|
|||
text-align: left;
|
||||
}
|
||||
|
||||
.sidebar-closed #main-content {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.sidebar-closed #sidebar {
|
||||
display: none !important;
|
||||
}
|
||||
#main-content.closed {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
#sidebar {
|
||||
width: 210px;
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
$(function () {
|
||||
var $sidebar = $("#sidebar");
|
||||
var $main = $('#main-content');
|
||||
|
||||
$('#nav-accordion').dcAccordion({
|
||||
eventType: 'click',
|
||||
autoClose: true,
|
||||
|
@ -20,21 +23,22 @@
|
|||
|
||||
$('#websiteFooter').text($('#footer').val());
|
||||
|
||||
$('#sidebar').on('click', 'a', function () {
|
||||
$sidebar.on('click', 'a', function () {
|
||||
var o = ($(this).offset());
|
||||
diff = 300 - o.top;
|
||||
if (diff > 0)
|
||||
$("#sidebar").scrollTo("-=" + Math.abs(diff), 500);
|
||||
$sidebar.scrollTo("-=" + Math.abs(diff), 500);
|
||||
else
|
||||
$("#sidebar").scrollTo("+=" + Math.abs(diff), 500);
|
||||
$sidebar.scrollTo("+=" + Math.abs(diff), 500);
|
||||
});
|
||||
|
||||
$('.sidebar-toggle-box').click(function () {
|
||||
if ($('#sidebar').is(":visible") === true) {
|
||||
$(".sidebar").addClass("sidebar-closed");
|
||||
$('.sidebar-toggle-box').on('click', function () {
|
||||
if ($sidebar.is(":visible") === true) {
|
||||
$sidebar.hide();
|
||||
$main.addClass('closed').removeClass('open');
|
||||
} else {
|
||||
$(".sidebar").removeClass("sidebar-closed");
|
||||
$("#sidebar").show();
|
||||
$sidebar.show();
|
||||
$main.addClass('open').removeClass('closed');
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<script src="~/Content/js/framework.js"></script>
|
||||
@RenderSection("Javascript", false)
|
||||
}
|
||||
<section class="sidebar">
|
||||
<section>
|
||||
@RenderSection("header", false)
|
||||
@RenderSection("navigator", false)
|
||||
<section id="main-content">
|
||||
|
|
Loading…
Reference in New Issue