Advertisement
abushyk

SB:relty_view carousel

Jan 25th, 2014
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. {literal}
  3. $(document).ready(function(){
  4.     if($('.carousel.property .content ul').length>0){
  5.         $('.carousel.property .content ul').carouFredSel({
  6.             scroll: {
  7.                 items: 1
  8.             },
  9.             auto: false,
  10.             next: {
  11.                 button: '.carousel.property .content .carousel-next',
  12.                 key: 'right'
  13.             },
  14.             prev: {
  15.                 button: '.carousel.property .content .carousel-prev',
  16.                 key: 'left'
  17.             }
  18.         });
  19.         $('.carousel.property .content li img').on({
  20.             click: function(e) {
  21.                 var src = $(this).attr('src');
  22.                 var img = $(this).closest('.carousel.property').find('.preview img');
  23.                 var img_a = img.parents('a').eq(0);
  24.                 img.attr('src', src);
  25.                 img_a.attr('href', src);
  26.                 $('.carousel.property .content li').each(function() {
  27.                     $(this).removeClass('active');
  28.                 });
  29.                 $(this).closest('li').addClass('active');
  30.             }
  31.         });
  32.        
  33.         $('.carousel.property ul li:first').addClass('active');
  34.     }
  35.    
  36.     $('a.lbgallery').lightBox();
  37. });
  38. {/literal}
  39. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement