Auto Scroll Down Links - Page 3 -...

User 2450707 Photo


Registered User
94 posts

Then it is worth another test here so!
Will let you know if it works for me...
User 2450707 Photo


Registered User
94 posts

I took async out and still not working here.
No errors in Console.

Hard to know what is stopping it.

User 2699991 Photo


Registered User
5,305 posts
Online Now

copy and paste this script again.

<script>
$(document).ready(function(){

$('a[href^="#"]').on('click', function(event) {
var target = $( $(this).attr('href') );
if( target.length ) {
event.preventDefault();
$('html, body').animate({
scrollTop: target.offset().top
}, 2000);
}
});

});
</script>
Mastering The Understanding With Hands-On Learning
NEW TO "COFFEECUP SITE DESIGNER" FOUNDATION 6 FRAMEWORK?
STUCK ON SOMETHING?

LEARNING & UNDERSTANDING "THE HOW TO"? THE WHY'S & THE WHEREFORE'S?
WITH WAYAN'S STEP BY STEP TUTORIALS


A simple quick way to contact me
https://mawarputih.coffeecup.com/forms/contact-wayan/
User 2699991 Photo


Registered User
5,305 posts
Online Now

I copied and loaded the script from your page and loaded it onto one of mine and it doesn't work, but i can't see why
Mastering The Understanding With Hands-On Learning
NEW TO "COFFEECUP SITE DESIGNER" FOUNDATION 6 FRAMEWORK?
STUCK ON SOMETHING?

LEARNING & UNDERSTANDING "THE HOW TO"? THE WHY'S & THE WHEREFORE'S?
WITH WAYAN'S STEP BY STEP TUTORIALS


A simple quick way to contact me
https://mawarputih.coffeecup.com/forms/contact-wayan/
User 2450707 Photo


Registered User
94 posts

Thanks for this.

I thought you were on to something here.
Your script has soft returns. Mine has hard returns at the end of each line.
That is the only difference between the scripts.
So, since yours is working, I replaced mine with yours.
Unfortunately, same thing. Not working. :(

Perhaps it will work tomorrow!
haha
User 2147646 Photo


Registered User
233 posts

You have the scripts inserted twice in the page. Once in a html element and the other in the footer. Also in the Jquery link you are missing the quotation marks around the source url :)

User 2450707 Photo


Registered User
94 posts

Thanks James,

The quote marks were significant and I have fixed that.
Thanks for noticing and pointing it out.
I have also deleted the dup from the footer.

Saved, exported and uploaded afresh.

I was expecting it to work this time.
But, still, it does not. :(

Perplexed!
User 2147646 Photo


Registered User
233 posts

You also have an older version of Jquery referenced in the head. I presume it is for the menu. Remove one of them incase it is causing a conflict :)

User 2450707 Photo


Registered User
94 posts

Thanks James,

Getting this to work has to be getting closer!

I have changed the menu to link to the latest Google jquery.
The menu still works fine.

I have commented out the same jquery above the Smooth Auto Scroll script.
Still did not work. :(

I have tried leaving it in and that did not work either.

(I presume that once jquery is called once on a page, there is no need to call it again.)



User 2147646 Photo


Registered User
233 posts

Hi Daniel, I have it working on a local copy of your page!
Incase there is an error replace the script with

<script>
$(document).ready(function(){
$('a[href^="#"]').on('click', function(event) {
var target = $( $(this).attr('href') );
if( target.length ) {
event.preventDefault();
$('html, body').animate({
scrollTop: target.offset().top
}, 2000);
}
});
});
</script>


Then in the url of the back to top link, change it to a relevant link so that it is

href="#Top" instead of href="http://www.playrightmusicltd.com/music-books.html#Top"

Hope that works now :)


Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.