Adding the scroll event script on navbar left in progress

This commit is contained in:
Prashant Singh 2019-03-12 19:10:26 +05:30
parent e512bad843
commit cd9504324c
3 changed files with 23 additions and 5 deletions

View File

@ -8,6 +8,24 @@ Vue.use(VeeValidate);
window.eventBus = new Vue();
$(document).ready(function () {
var lastScrollTop = 0;
$(document).on('scroll', function() {
var st = $(this).scrollTop();
if (st > lastScrollTop) {
$('.navbar-left').css('top', st+'px');
} else if (st == lastScrollTop) {
//do nothing
//In IE this is an important condition because there seems to be some instances where the last scrollTop is equal to the new one
} else {
// console.log("up");
// console.log(st);
$('.navbar-left').css('top', st+'px');
}
lastScrollTop = st;
});
Vue.config.ignoredElements = [
'option-wrapper',
'group-form',

View File

@ -95,9 +95,9 @@ body {
}
.navbar-left {
position: sticky;
top: 0;
// bottom: 0;
position: absolute;
top: 60px;
bottom: 0;
width: 90px;
padding-top: 20px;
height: auto;
@ -150,7 +150,7 @@ body {
right: 0;
left: 0;
bottom: 0px;
min-height: calc(100% - 60px);
height: calc(100% - 60px);
width: 100%;
.inner-section {

View File

@ -12,7 +12,7 @@ use Webkul\Core\Repositories\SliderRepository as Slider;
* @author Prashant Singh <prashant.singh852@webkul.com> @prashant-webkul
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class SliderController extends controller
class SliderController extends Controller
{
/**
* Contains route related configuration