| | #1 |
| Warrior Member Join Date: 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
| HelloFriends i have a jquery problem. whenever i tried to apply on click scroll script i got this error "uncaught typeError: cannot read property 'top' of null". Here following is code of Jquery.How can this will be fixed. $(document).ready(function($){ $('a[href^="#"]').bind('click.smoothscroll',function (e) { e.preventDefault(); var target = this.hash, $target = $(target); $('html, body').stop().animate({ 'scrollTop': $target.offset().top }, 900, 'swing', function () { window.location.hash = target; }); }); }); |
| |
| | #2 | |
| Advanced Warrior War Room Member Join Date: 2004 Location: Perth, Australia.
Posts: 724
Thanks: 6
Thanked 184 Times in 136 Posts
|
I guess from this error, that $target is not defined.. Might need to do some console debugging and see what it comes back with. Hope this helps bruce
| |
| |
| | #3 |
| ResponsiveDesignTest.Net Registered Member Join Date: 2011 Location: Rostock, Germany
Posts: 829
Thanks: 106
Thanked 225 Times in 194 Posts
|
Give me the URL please.
|
|
HTML/CSS/jQuery/ZURB Foundation/Twitter Bootstrap/Wordpress/Frontend Performance Optimizing --- Need HTML/CSS help? Skype: microcosmic - Test Your Responsive Design - InternetCookies.eu | |
| |
|
| Bookmarks |
| Tags |
| fix, null, property, read, top, typeerror, uncaught |
| |