- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › Script only expands sidebar to height of content
Hello, I’m trying to make my sidebar expand the length of the website, not the content. But it’s only doing the contents height. So if it doesn’t fill the screen, then it cuts my sidebar off.
Here’s my script:
$(document).ready(function() { $('#sideBar').height($('html').height()); });
I thought using html would make it fit the whole height of the screen. Here’s a image as an example of it going wrong: http://i.imgur.com/0WekbZa.png
Can someone elaborate what I’m doing wrong? Thanks!
(I’m extremely horrible at JS so please be easy.)
We cant diagnose an image…we need a live example of HTML/CS/Js code…ideally in a Codepen.io demo.
Not the whole page…just enough to show the issue.
I can’t really do a codepen.io, because it’s through a forum software. i.e. I’d have to transfer a lot of code over to codepen just to show one bug. But if you visit https://forum.leftalt.com/member.php?action=login you’ll see the sidebar cuts off.
Try giving the html
and body
tags a min-height
of 100%.
That should do it.