Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
131
rated 0 times [  132] [ 1]  / answers: 1 / hits: 64539  / 9 Years ago, wed, july 15, 2015, 12:00:00

I have NEXT and PREVIOUS buttons on my screen. When the page initially loads I want the Previous button to be hidden and as soon as user clicks the Next button I want Previous button (div tag to be visible). I have a CSS property for Previous button where I am setting the visibility value to False.
And also an if statement where I check to see if page counter is greater than 1 then change the visibility of navigationButtonTop to true. It is not working..what am I doing wrong !?





$(function() {
$(#navigationButtonTop).css(visibility, visible);
});

div.navigationButtonTop {
visibility: hidden;
height: 100px;
width: 100px;
background-color:blue;
}

<script src=https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js></script>
<div class=navigationButtonTop></div>




More From » jquery

 Answers
9

firstly you have not closed your if statement and navigationButtonTop is a class not a id try this.



if (that.get(pageCounter) >= 1) {
$(.navigationButtonTop).css(visibility, visible);
}


as the OP has edited his question the new answer would be:



$(function() {
$(.navigationButtonTop).css(visibility, visible);
});

[#65799] Monday, July 13, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jaylanw

Total Points: 730
Total Questions: 98
Total Answers: 95

Location: Saudi Arabia
Member since Tue, Nov 29, 2022
2 Years ago
;