Keyword
Please note that official support for commercial extensions & templates is provided in the Subscriber Help Desk.
Support requests should ONLY be directed there and require an active subscription plan.
This forum board is to be used for archive purposes and knowledge exchange ONLY.

Change JS to make Galleria auto rotate

  • Francisco Caivano Zori
  • Francisco Caivano Zori's Avatar Topic Author
  • Offline
  • Junior Member
More
12 years 9 months ago #47360 by Francisco Caivano Zori
Change JS to make Galleria auto rotate was created by Francisco Caivano Zori
Im tryng to make the Galleria template to "auto rotate"

    jQuery.noConflict();
jQuery(document).ready(function($){

$('.sigProGalleriaLink').click(function(event){

event.preventDefault();

// Prevent clicks upon animation
if($(':animated').length) return false;

// Assign element
var el = $(this);

// Parent container
var outerContainer = el.parent().parent().parent().parent().parent();
var placeholderContainer = outerContainer.find(".sigProGalleriaPlaceholderContainer div:first");

// Placeholder elements
  var targetLink = placeholderContainer.find("a:first");
  var targetTitle = placeholderContainer.find("p:first");
  var targetImg = targetLink.find("img:first");

  if(targetLink.hasClass('sigProGalleriaTargetLink')){

// Source elements
  var sourceLinkHref = el.attr("href");
  var sourceLinkTitle = el.attr("title");
  var sourceImage = el.find("img:first");
  if(el.find("span:nth-child(2)")){
  var sourceTitle = el.find("span:nth-child(2)").find("b:first").html();
  } else {
  var sourceTitle = false;
  }

placeholderContainer.animate({'opacity':0},300,function(){
targetImg.attr("src",sourceLinkHref);
targetImg.load(function(){
targetImg.attr("title",sourceImage.attr("title"));
targetImg.attr("alt",sourceImage.attr("alt"));
targetLink.attr("href",sourceLinkHref);
targetLink.attr("title",sourceLinkTitle);
if(targetTitle.hasClass('sigProGalleriaTargetTitle') && sourceTitle) targetTitle.html(sourceTitle);
placeholderContainer.animate({'opacity':1},600);
});
});

  }

// Set class for current thumb
var thumbs = outerContainer.find("ul:first").find("a");
thumbs.each(function(){
if($(this).hasClass('sigProLinkSelected')){
$(this).removeClass('sigProLinkSelected');
}
});
el.addClass('sigProLinkSelected');

});

});



Im tryng to change it, so the animation occur's automatically (auto rotates) instead of the need to being clicked.

Thanks

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum