-
Notifications
You must be signed in to change notification settings - Fork 55
[Fix: #45] Added animation to section scrolls [Smooth Scrolling] #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@shashank7200 here is the problem with your implementation of smooth scroll.
|
realslimshanky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to make smooth scroll work like this is leaving dead links behind. A different approach is needed to make this work.
js/main.js
Outdated
| ADD ANIMATIONS TO SECTION SCROLL | ||
| -------------------------------------- */ | ||
| $('a[href*=\\#]').on('click', function(event){ | ||
| event.preventDefault(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes 'Speakers' button a dead link when clicked from any other page than index.html. Different approach is needed to make it work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@realslimshanky okay, let me fix that.
|
@shashank7200 according to your new changes, on clicking on 'Speakers' takes us to the Speaker tab on index.html page but smooth scroll is not working. i.e. the feature that you are proposing works only when we are at index.html and not on any other page (which is 6 out of 7 case). |
|
@realslimshanky solved it! |
|
There are few glitches on the mobile browsers while testing. I would wait to see other people's review. |
| /* ------------------------------------- | ||
| ADD ANIMATIONS TO SECTION SCROLL | ||
| -------------------------------------- */ | ||
| function ea_scroll( hash ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please indent your JS correctly :)
|
@shashank7200 one level backward. Should go at the same level as your comment. |
|
@CuriousLearner When I indented the code in the editor, it was perfect but, after pushing code to github, it is showing unindented. |
24c1a59 to
9ca8ab0
Compare
|
@CuriousLearner done! |
|
Hey, Thanks for your contributions! As I see on the link you mentioned, whenever I click on the #speakers link as you mentioned on the issue, it redirects me to your portfolio site. Can you please have a look at this? |
|
@CuriousLearner See that is not a problem, that is a behaviour of that website which was earlier implemented, I can change it but, it'll be not good to change it. You can test it locally, it'll work fine. I had long discussion with @realslimshanky explaining this behaviour. From a talk to @realslimshanky , what I explained to him:
|
|
I know this would show up correctly once deployed or on local testing. My main concern here is, when we archive this site, it should work correctly that time too, which not might be the case. |
|
@CuriousLearner In this case, what should I do then? |
|
@shashank7200 Rather than referencing it from the root, add an anchor with respect to the current page. |
|
@CuriousLearner I am doing what you suggested, but I must say, it will not redirect you to the homepage's speakers section afterwards from external links |
|
Yes, you're right. Let me think how can we do this. |
|
Okay @CuriousLearner |
|
Sorry for delay @shashank7200
|
|
@realslimshanky Done changes locally, but it breaks the functionality. I can suggest we can do the needful changes while archiving and leave the Here's the output of locally tested changes: |
|
This is temporary but might work. |
|
I'm not sure. @theskumar How should we go around this/ |

Uh oh!
There was an error while loading. Please reload this page.