mirror of
https://github.com/dawidolko/Website-Templates.git
synced 2026-03-23 02:12:17 +00:00
Website templates
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
$(function() {
|
||||
|
||||
var Page = (function() {
|
||||
|
||||
var $nav = $( '#nav-dots > span' ),
|
||||
slitslider = $( '#slider' ).slitslider( {
|
||||
onBeforeChange : function( slide, pos ) {
|
||||
|
||||
$nav.removeClass( 'nav-dot-current' );
|
||||
$nav.eq( pos ).addClass( 'nav-dot-current' );
|
||||
|
||||
}
|
||||
} ),
|
||||
|
||||
init = function() {
|
||||
|
||||
initEvents();
|
||||
|
||||
},
|
||||
initEvents = function() {
|
||||
|
||||
$nav.each( function( i ) {
|
||||
|
||||
$( this ).on( 'click', function( event ) {
|
||||
|
||||
var $dot = $( this );
|
||||
|
||||
if( !slitslider.isActive() ) {
|
||||
|
||||
$nav.removeClass( 'nav-dot-current' );
|
||||
$dot.addClass( 'nav-dot-current' );
|
||||
|
||||
}
|
||||
|
||||
slitslider.jump( i + 1 );
|
||||
return false;
|
||||
|
||||
} );
|
||||
|
||||
} );
|
||||
|
||||
};
|
||||
|
||||
return { init : init };
|
||||
|
||||
})();
|
||||
|
||||
Page.init();
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user