I'm using lightslider. I'm trying to reach to the first slide when you hit the last ine but I cannot use loop for layout reasons. I added a last li after the dynamic gallery and added and if li is active go to slide, but doesn't work and neither returns errors. Any idea what's wrong?
  jQuery(document).ready(function() {
      var sliderhome = jQuery('#slider-home').lightSlider({
    controls: true,
    prevHtml: '<span>PREV</span>',
    nextHtml: '<span>NEXT</span>',
    loop: true,
            pause: 5000,
            item: 1,
    enableDrag: false,
            mode: "slide",
            onSliderLoad: function() {
            jQuery('#slider-home').removeClass('cS-hidden');
            }
});
  });
if (jQuery("#lasthome").hasClass("active")) {
               sliderhome.goToSlide(1);
}