0

I create horizontal scroller for run to the left and right the elements inside content , my script it´s this :

<script>
jQuery(document).ready(function() 
{
var $item = jQuery(".productos_items"), 
visible = 3, 
index = 0, 
endIndex=($item.length/visible)-1; 

jQuery('#productos_arrowR').click(function(){
if(index < endIndex ){
index++;
$item.animate({'left':'-=100px'});
}
});

jQuery('#productos_arrowL').click(function(){
if(index > 0){
index--;            
$item.animate({'left':'+=100px'});
}
});
});
</script>

I try something as this :

if ($item>=visible)
{
jQuery(".productos_items").css("display","none")
}

But no works

The problem it´s i can´t get hide the elements , for example i put visible first 3 items and after this i want hide the others and when push to the right show this and hide the other

I try different things but i can´t get this finally

Thank´s

user2912997
  • 15
  • 1
  • 6

1 Answers1

0

try this:

if ($item.length >= visible)    {
    $item.hide()
}
iKBAHT
  • 644
  • 6
  • 17