Skip to content

Instantly share code, notes, and snippets.

@surjithctly
Created August 24, 2015 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save surjithctly/c8c7775f34e925d64782 to your computer and use it in GitHub Desktop.
Save surjithctly/c8c7775f34e925d64782 to your computer and use it in GitHub Desktop.
Features Rotator
/*http://good.co/*/
$(document).ready(function (){
// If menu item has classname "nav-no-click" then return false
$('li.nav-no-click > a').click( function() {
return false;
});
$('#features-rotator-row').find('.features-rotator-item').each(function(index, element) {
$(element).mouseover(function(e) {
$('#features-rotator').trigger( 'slideTo', [index, 0, true] );
$('#features-rotator').trigger('pause', true);
return false;
});
$(element).mouseout(function(e) {
$('#features-rotator').trigger('play');
return false;
});
});
$('#features-rotator').carouFredSel({
items : 1,
scroll : {
items : 1,
fx : 'cover',
easing : "elastic",
duration : 0,
onBefore : function() {
var pos = $(this).triggerHandler( 'currentPosition' );
$('#features-rotator-row .features-rotator-item').css('opacity', 1);
$('#features-rotator-row .features-rotator-item').find('.features-item-icon-active').css('display', 'none');
$('#features-rotator-row .features-rotator-item').find('.features-item-icon-noactive').css('display', 'block');
$('#features-rotator-row').find('.features-rotator-item').eq(pos).find('.features-item-icon-active').css('display', 'block');
$('#features-rotator-row').find('.features-rotator-item').eq(pos).find('.features-item-icon-noactive').css('display', 'none');
}
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment