Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #433824

    The numbers don’t animate unless I resize my browser window or if the animated numbers are visible at load (if browser screen is at 80% or less or 100% on a very large monitor). But at a normal laptop at 1440×900 at 100%, the animated numbers are frozen. For some reason that will start the animation but all the numbers stay at 0 when at first load or refresh.

    I’ve troubleshooted as far as I could. I’ve narrowed it down to helper-main-menu.php.

    The only chunk of custom code inserted in that file is the header/logo and text that I load above the main menu.

    Here’s the snippet:

    		
    						
    						//phone/info text	
    						$phone			= $headerS['header_phone_active'] != "" ? $headerS['phone'] : "";
    						$phone_class 	= !empty($nav) ? "with_nav" : "";
    						if($phone) 		{ echo "<div class='phone-info {$phone_class}'><span>".do_shortcode($phone)."</span></div>"; }
    							
    							
    			        ?>
    			      </div>
    	<div id="signature">
    			<div id="lockup" class="container">
    				<div>
    					<a href="<?php echo site_url(); ?>"><img id="logo" src="URL HERE" alt="UCLA logo" /><span id="department"><?php echo get_option("department"); ?></span></a>
    				</div>
    				<span id="division"><a href="<?php echo site_url(); ?>"><?php bloginfo( $show ); ?></a></span>
    			</div>
    	</div>
    		</div>
    
    <?php } ?>
    

    If I remove that div code that renders the banner, the numbers animate. Any idea why this is happening? Thanks!

    • This topic was modified 9 years, 7 months ago by Josue.
    #434390

    Hey albertoSSC!

    Please try adding following code to Functions.php file in Appearance > Editor

    function custom_animated(){
    ?>
    <script>
    jQuery(window).scroll(function(){
        jQuery('.avia-animated-number').each( function(i){
            var bottom_of_object = jQuery(this).offset().top + jQuery(this).outerHeight();
            var bottom_of_window = jQuery(window).scrollTop() + jQuery(window).height();
            if( bottom_of_window > bottom_of_object ){
                jQuery(this).addClass('avia_start_animation');
            }
        }); 
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_animated');

    Cheers!
    Yigit

    #434396

    Thanks Yigit!

    Unfortunately I pasted the code into my child theme’s functions.php and nothing changed and the website is still exhibiting the same behavior. :(

    #434400

    Hi!

    Do you mind creating a temporary admin login and posting it here privately so we can look into it?

    Best regards,
    Yigit

    #434412
    This reply has been marked as private.
    #434429

    Hi!

    Have you removed your custom code from includes/helper-main-menu.php files? I cannot find it. Also, files are not writable, so i cannot edit through WordPress dashboard

    Best regards,
    Yigit

    #434501
    This reply has been marked as private.
    #435697

    Hi!

    Access provided here doesn’t work, please check.

    Cheers!
    Josue

    #435706
    This reply has been marked as private.
    #435727

    Hi!

    Can you please hand me a FTP account too via private reply? i’m a bit worried about breaking something while editing files from the Dashboard and then being unable to access due to white screen.

    Best regards,
    Josue

    #435736
    This reply has been marked as private.
    #435753

    Hey!

    The issue is caused by this code you have in child style.css:

    html, body {
    	height: 100% !important;
    }
    	
    html {
    	overflow-y: hidden;
    }
    
    body {
    	overflow-x: hidden;
    }

    Cheers!
    Josue

    #435758

    Thanks so much for the fix Josue! You’re a savior!

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Animated Numbers Not Animating’ is closed to new replies.