frio mobile: disable page scroll when aside is shown
This commit is contained in:
parent
1da4b9d942
commit
d162e689da
2 changed files with 17 additions and 0 deletions
|
@ -127,6 +127,8 @@ code {
|
|||
opacity: 1;
|
||||
}
|
||||
|
||||
/* prevent page scroll when the aside is opened **/
|
||||
body.aside-out { overflow: hidden; }
|
||||
}
|
||||
/*
|
||||
* standard page elements
|
||||
|
|
|
@ -338,6 +338,21 @@ $(document).ready(function(){
|
|||
$(document.body).trigger("sticky_kit:recalc");
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* Add or remove "aside-out" class to body tag
|
||||
* when the mobile aside is shown or hidden.
|
||||
* The class is used in css to disable scroll in page when the aside
|
||||
* is shown.
|
||||
*/
|
||||
$("aside")
|
||||
.on("shown.bs.offcanvas", function() {
|
||||
$("body").addClass("aside-out");
|
||||
})
|
||||
.on("hidden.bs.offcanvas", function() {
|
||||
$("body").removeClass("aside-out");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function openClose(theID) {
|
||||
|
|
Loading…
Reference in a new issue