Posts

Showing posts from July, 2018

JavaScript code

// Select ==================> $( ".heapbox" ).heapbox( { effect : { "type" : "slide" , "speed" : "fast" }, "onChange" : function ( val, elm ) { elm.trigger( 'change' ); } } ); // auto increament class name $( document ).ready( function ( e ) { $( 'ul li' ).each( function ( i ) { i = i + 1 ; $( this ).addClass( 'item-' + i ); } ); } ); $( window ).scroll( function () { jQuery( '.home .header nav > ul > li > a' ).each( function() { var $scroll = jQuery( window ).scrollTop(); var $href = jQuery( this ).attr( 'href' ); var $offset = jQuery( $href ).offset().top - jQuery( '.header' ).outerHeight(); var $el_height = jQuery( $href ).outerHeight(); if ( $scroll >= $offset && $scroll < $offset + $el_height ) { jQuery( this ).parent( 'li' ).addClass( 'is-active' ).siblin...