jQuery( document ).ready( function( $, wpcom ) { var masterbar, menupops = $( 'li#wp-admin-bar-blog.menupop, li#wp-admin-bar-newdash.menupop, li#wp-admin-bar-my-account.menupop' ), newmenu = $( '#wp-admin-bar-new-post-types' ); // Unbind hoverIntent, we want clickable menus. menupops .unbind( 'mouseenter mouseleave' ) .removeProp( 'hoverIntent_t' ) .removeProp( 'hoverIntent_s' ) .on( 'mouseover', function(e) { var li = $(e.target).closest( 'li.menupop' ); menupops.not(li).removeClass( 'ab-hover' ); li.toggleClass( 'ab-hover' ); } ) .on( 'click touchstart', function(e) { var $target = $( e.target ); if ( masterbar.focusSubMenus( $target ) ) { return; } e.preventDefault(); masterbar.toggleMenu( $target ); } ); masterbar = { focusSubMenus: function( $target ) { // Handle selection of menu items if ( ! $target.closest( 'ul' ).hasClass( 'ab-top-menu' ) ) { $target .closest( 'li' ); return true; } return false; }, toggleMenu: function( $target ) { var $li = $target.closest( 'li.menupop' ), $html = $( 'html' ); $( 'body' ).off( 'click.ab-menu' ); $( '#wpadminbar li.menupop' ).not($li).removeClass( 'ab-active wpnt-stayopen wpnt-show' ); if ( $li.hasClass( 'ab-active' ) ) { $li.removeClass( 'ab-active' ); $html.removeClass( 'ab-menu-open' ); } else { $li.addClass( 'ab-active' ); $html.addClass( 'ab-menu-open' ); $( 'body' ).on( 'click.ab-menu', function( e ) { if ( ! $( e.target ).parents( '#wpadminbar' ).length ) { e.preventDefault(); masterbar.toggleMenu( $li ); $( 'body' ).off( 'click.ab-menu' ); } } ); } } }; } );; (function ($) { $( window ).load(function() { $(document.body).on('click', '.ab-banner-link', function(pageCollapse){ // changed .hover to .each $('div').each(function() { var a = Math.random() * 10 - 5; $(this).css('transform', 'rotate(' + a + 'deg)'); }); //all images get hinge $('img').each(function(i) { var $li = $(this); setTimeout(function() { $li.addClass('animated hinge'); }, i*300); // delay 100 ms }); //all left rail artciles get bounce $($('.article-list div').get().reverse()).each(function(i){ var $li = $(this); setTimeout(function() { $li.addClass('animated bounce'); }, i*50); // delay 100 ms }); //turn on ad-blocker-modal after a few seconds setTimeout(function(){ $('#ad-blocker-modal').show(); }, 4000); //Do Reverse $('#ad-blocker-modal').click(function(){ $('#ad-blocker-modal').hide(); $('div').each(function() { $(this).css('transform', 'rotate(' + 0 + 'deg)'); }); //all images get hinge $('img').each(function(i) { var $li = $(this); setTimeout(function() { $li.removeClass('animated hinge'); }, i*300); // delay 100 ms }); //all left rail articles get bounce $($('.article-list div').get().reverse()).each(function(i){ var $li = $(this); setTimeout(function() { $li.removeClass('animated bounce'); }, i*50); // delay 100 ms }); $('.left-rail-topper').css({'top': '0', 'position': 'fixed'}); $('.left-rail').css('padding-top', '0'); // auto-refresh page to render regular ads window.location.reload(); }); }); }); })(jQuery);;