Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
mi condición if no se ocultará en consecuencia mis botones siguiente y anterior

Necesito una condición if que oculte el botón anterior de la primera página = 1, y en la página 8 oculta el botón siguiente. Usé el siguiente código e intenté, pero no se oculta en consecuencia:

 var page = 8; if(page == 0){ $("#prev-button").hide(); $("#next-button").show(); }else if (page == 8) { $("#prev-button").show(); $("#next-button").hide(); }
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <div class="load-more" id="next-button"> <a href="${nextUrl}" class="btn-on-white white">Next</a> </div> <div class="previous" id="prev-button"> <a href="${prevUrl}" class="btn-on-white-test white">Prev</a> </div>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Tal vez esto te ayude en lo que estás tratando de lograr:

 var page = 0; $("#prev-button").hide(); $("#next-button").show(); function showBoth() { if (page < 8 && page > 0) { $("#prev-button").show(); $("#next-button").show(); } } $("#prev-button").on("click", function () { page--; showBoth(); if (page == 0) $(this).hide(); }); $("#next-button").on("click", function () { page++; showBoth(); if (page == 8) $(this).hide(); });
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!