Reputation: 1011
I am trying to stop the transition on the banner so if there is one image uploaded it doesnt loop through it - it just stays static and doesnt move about (no transitions)
I've tried using this on Nivoslider
if ($(".nivoSlider").children().length === 1)
$(".nivo-controlNav").hide(0);
The full script here;
<script type="text/javascript">
$(window).load(function () {
var total = $('#slider img').length;
var rand = Math.floor(Math.random() * total);
if ($(".nivoSlider").children().length === 1)
$(".nivo-controlNav").hide(0);
$('#slider').nivoSlider({
effect: 'fade',
animSpeed: '500',
pauseTime: '5000',
startSlide: rand
});
});
</script>
I've also tried this;
if($('.nivoSlider').find('img').size()===1)
{
$('.nivo-directionNav').remove();
}
How can i stop it without changing anything in the main nivoslider js file?
It happens on this page http://securushealthandsafety.co.uk/health-and-safety-training/iosh-approved-coaching-for-safety.aspx
Upvotes: 0
Views: 1116
Reputation: 9131
Have you tried
#slider
nivoSlider
Eg.
if ($("#slider").find("img").length > 1)
{
$('#slider').nivoSlider({
effect: 'fade',
animSpeed: '500',
pauseTime: '5000',
startSlide: rand
});
}
Upvotes: 1