Tagged: animated numbers
-
AuthorPosts
-
April 24, 2015 at 12:33 am #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, 6 months ago by Josue.
April 24, 2015 at 8:40 pm #434390Hey 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!
YigitApril 24, 2015 at 8:45 pm #434396Thanks 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. :(
April 24, 2015 at 8:48 pm #434400Hi!
Do you mind creating a temporary admin login and posting it here privately so we can look into it?
Best regards,
YigitApril 24, 2015 at 8:54 pm #434412This reply has been marked as private.April 24, 2015 at 9:11 pm #434429Hi!
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,
YigitApril 24, 2015 at 11:10 pm #434501This reply has been marked as private.April 27, 2015 at 10:43 pm #435697April 27, 2015 at 11:09 pm #435706This reply has been marked as private.April 27, 2015 at 11:59 pm #435727Hi!
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,
JosueApril 28, 2015 at 12:28 am #435736This reply has been marked as private.April 28, 2015 at 1:59 am #435753Hey!
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!
JosueApril 28, 2015 at 2:14 am #435758Thanks so much for the fix Josue! You’re a savior!
-
AuthorPosts
- The topic ‘Animated Numbers Not Animating’ is closed to new replies.