jd says jd says - 5 months ago 14x
Javascript Question

How to disable next/prev button when slider have only one image?

When slider have one image then don't want next/prev button but if slider have more than 1 images then required next/prev button. Can you please suggest me JavaScript code to do. I know how to disable next/prev through controls false

controls : false

but it is also false when image have more than one image.
Here is my code,

var imgCnt = $('#images').val(); //get images count.
if(imgCnt == 1){


I have tried this code and it's working fine. Please try to your program. Using ternary operator.

        controls: ($("ul.bxslider").length > 1) ? true: false,