View Single Post
Old 02-04-2011, 02:45 PM   PM User | #1
leetvivi
New Coder

 
Join Date: Feb 2011
Posts: 12
Thanks: 1
Thanked 1 Time in 1 Post
leetvivi is an unknown quantity at this point
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) {
        var k = new Number(i);
        if (index == 0) {
            $('#previous').hide();
        }

        else {
            $('#next').show();
            index = index - 1;
            eventSelected(rawDates[index], rawTime[index]);

        }
    }
And in my html...the div properties:

Code:
<div style="text-align:right;">
                        <div id="next" style="float:right;"><a onclick="javascript:nextEvent();">
                        <input type="image" name="next" src="images/SiteCollectionImages/MiniEvents/btn_Next.gif" alt="Next Event" title="Next Event"/></a>
                        </div>
                        <div id="previous" style="float:right; padding-right:2px;"><a onclick="javascript:previousEvent();">
                        <input type="image" name="previous" src="images/SiteCollectionImages/MiniEvents/btn_Previous.gif" alt="Previous Event" title="Previous Event"/></a>
                        </div>
edit:
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
leetvivi is offline   Reply With Quote