Reputation: 456
Solved thanks to Matt!
So this is an odd bug ive come across redoing my new site. I have added a testimonial second on one page and it seems to have "broken" the smooth scroll Jquery I had working.
The Beta site is here... www.anim-house.co.uk You can see the scroll working fine. On www.anim-house.co.uk/portfolio.html The scroll does not work - the addition of
$(document).ready(function(){
$('#fade').list_ticker({
speed:14000,
effect:'fade'
});
});
Seems to have broken it? Im amateur when it comes to Jquery if someone could look through and figure out the error id greatly appreciate it.
Upvotes: 0
Views: 148
Reputation: 1307
$('a[href*=#]').each(function() { console.log(this.hash)})
#contact
#cgi
#web-design
#graphic-design
#motion-graphics
#photography
#home
#cgi
#web-design
#graphic-design
#motion-graphics
#photography
#home
null
null
null
It is those last three that are causing the error. They are related to links with href="#". Instead of checking for
if(target) {
Check for
if ($target && target) {
EDIT: OP got it working with this: http://paulund.co.uk/smooth-scroll-to-internal-links-with-jquery
The website looks very nice, by the way.
Upvotes: 1
Reputation: 28737
You have an error in your portfolio.html:
This is what I got from the Chrome dev-tools:
Uncaught TypeError: Cannot read property 'top' of undefined at line 66
The affected line is:
var targetOffset = $target.offset().top;
After getting that error, the browser stops processing and your plugin is likely not loaded. Fixing this error should fix the rest as well (provided there are no other errors)
Upvotes: 1