Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.03 KB | None | 0 0
  1. $(document).ready(function(){
  2.  
  3.   jQuery('#flip').jcarousel({
  4.     scroll:  1,
  5.     wrap:    'circular',
  6.     visible: 3,
  7.     auto:    3});
  8.  
  9.  
  10.   var images = $('#splash').attr('data-images').split(',');
  11.   var hrefs = $('#splash a.caption').attr('data-hrefs').split(',');
  12.   var titles = $('#splash a.caption').attr('data-titles').split(',');
  13.   var items = $('#splash a.caption span.item').attr('data-texts').split(',');
  14.   var stores = $('#splash a.caption span.store').attr('data-texts').split(',');
  15.  
  16.   $.each(images,function(key,value){  
  17.     $('<img />').attr('src', 'images/goods/' + value + '.jpg');
  18.   });
  19.  
  20.   var counter = 0;
  21.   setInterval(function () {
  22.     counter++;
  23.     var index = (counter%images.length);
  24.     $('#splash').css({'background-image' : ('url(images/goods/' + images[index] + '.jpg)')});
  25.     $('#splash a.caption').attr({'href' : hrefs[index], 'title' : titles[index]});
  26.     $('#splash a.caption span.item').text(items[index]);
  27.     $('#splash a.caption span.store').text(stores[index]);
  28.    }, 5 * 1000);
  29. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement