-1

I am working with a dashboard panel and I have run into a bug. I have tried a lot to resolve this bug and the only way is by removing this code. Use the middle button of your mouse to scroll down so you can see the bug. The scrollbutton.

$(document).ready(function() {
    $("#NS-02").niceScroll({cursorcolor:"#575961", autohidemode: true, cursorwidth: 8});
    $("#Content").height($(window).height()).width($(window).width()-$("#Left-navigation").width());
    $("#Content").niceScroll({cursorcolor:"#a3a3a3", autohidemode: false});   
});

But If I remove that code my dashboard messes up, hopefully someone knows how to resolve this.

LINK TO THE WEBSITE.

Samuel Masih
  • 54
  • 1
  • 8
  • Maybe actually telling us what the bug is could help. – Aioros Dec 02 '13 at 13:40
  • As stated, I am using **NiceScrolls** on my website and the bug appeared when I added the top navigation bar on the webpage the light gray one which has the height of 50px and another 5px for margin-bottom. And the amount of the extra whitespace I have is 55 px. It was something to do with the line `$("#Content").height($(window).height()).width($(window).width()-$("#Left-navigation").width());` – Samuel Masih Dec 02 '13 at 13:44

1 Answers1

1

Ok, if I understood what you wanted, the problem is that the #Content div is too high, since you added another div on top. So you could change the line you indicated in this way:

$("#Content").height($(window).height() - $("#Top-navigation").outerHeight(true)).width($(window).width()-$("#Left-navigation").width());

and I think you should also remove the height and width of the Content div from the HTML.

Aioros
  • 4,373
  • 1
  • 18
  • 21
  • That solved it pretty much, still got that extra 5px from the margin-bottom left tho. – Samuel Masih Dec 02 '13 at 13:58
  • Right, the margin. You could use .outerHeight() instead of height, like: `$("#Top-navigation").outerHeight(true)`. The `true` parameter is to include margin in the calculation. I'll update the answer. – Aioros Dec 02 '13 at 14:00
  • Thanks a lot for your time and help Aioros. – Samuel Masih Dec 02 '13 at 14:21