I have a div that loads in the number of images on each page. For example:
<div class="totalimages">1</div>
<div id="arrows">NEXT</div>
When I have one image, i'd like to hide the #arrows div. I'm not very good with jQuery so I was wondering what the syntax would be for it to be,
IF the .totalimages div equals '1' then HIDE the div #arrows.
Thank you!
Try this:
if ($(".totalimages").text() == "1") {
$("#arrows").hide();
}
or in one line:
$("#arrows").toggle($(".totalimages").text() != "1");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With