![]() |
Hiding a div (picture) and still holding its position
Completely new to jQuery / Javascript, so sorry if I'm not very clear.
I'm currently trying to hide my navigation button when it hides the end of the list, right now I currently have: Previous / Next (they are about the same anyways) Code:
function previousEvent(i) {Code:
<div style="text-align:right;">Sorry forgot to explain, I'm trying to make it so when they click on next, and keep clicking until the end of the dataset, it will hold the previous button where it usually is. Instead right now it moves it over to where the "Next" button is. I figured there has to be a way to hide the button, but yet hold the position still. Thanks in advance! Matt |
If you give an element display: none (and that's what's actually happening inside hide()), it will be removed from the document flow, and the positions of other elements will change. If you want a hidden element to stay in the flow and retain its position, use visibility: hidden instead.
So, instead of $(yourElement).hide() you do $(yourElement).css({visibility: 'hidden'}), and instead of $(yourElement).show() you do $(yourElement).css({visibility: 'visible'}). |
venegal, I cannot thank you enough!
I was literally ripping my hair out over this easy one liner of code :) Thanks!! |
| All times are GMT +1. The time now is 07:28 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.