AjayAsnani / REACT-JS-Portfolio

3 stars 0 forks source link

Nav problem #1

Open goktugfevzi opened 1 year ago

goktugfevzi commented 1 year ago

I click to go to the contact section, another icon becomes active. nav is wrong to solve this

     const offsetTop = section.offsetTop + 5;

you should add

AjayAsnani commented 1 year ago

I don't get it what you said

On Sun, Jun 11, 2023, 10:52 PM Goktug Fevzi Ozcelik < @.***> wrote:

I click to go to the contact section, another icon becomes active. nav is wrong to solve this

 const offsetTop = section.offsetTop + 5;

you should add

— Reply to this email directly, view it on GitHub https://github.com/AjayAsnani/REACT-JS-Portfolio/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYJYKQVO7QTUGQOUUJYYMLTXKX5E5ANCNFSM6AAAAAAZCOYDOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

goktugfevzi commented 1 year ago

https://github.com/AjayAsnani/REACT-JS-Portfolio/assets/64567701/b2df2f5a-49d8-4201-92e6-3e576279cc5e

AjayAsnani commented 1 year ago

Thanks, I'll check it out!

On Sun, Jun 11, 2023, 11:03 PM Goktug Fevzi Ozcelik < @.***> wrote:

https://github.com/AjayAsnani/REACT-JS-Portfolio/assets/64567701/b2df2f5a-49d8-4201-92e6-3e576279cc5e

— Reply to this email directly, view it on GitHub https://github.com/AjayAsnani/REACT-JS-Portfolio/issues/1#issuecomment-1586257340, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYJYKQSP4NUZPONZNRYOMDDXKX6OBANCNFSM6AAAAAAZCOYDOI . You are receiving this because you commented.Message ID: @.***>

AjayAsnani commented 1 year ago

The issue you are getting is because of the difference in screen size and pixels as it works fine in my devices still I will try to solve it in the best way possible.

On Mon, Jun 12, 2023 at 12:27 AM Ajay Asnani @.***> wrote:

Thanks, I'll check it out!

On Sun, Jun 11, 2023, 11:03 PM Goktug Fevzi Ozcelik < @.***> wrote:

https://github.com/AjayAsnani/REACT-JS-Portfolio/assets/64567701/b2df2f5a-49d8-4201-92e6-3e576279cc5e

— Reply to this email directly, view it on GitHub https://github.com/AjayAsnani/REACT-JS-Portfolio/issues/1#issuecomment-1586257340, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYJYKQSP4NUZPONZNRYOMDDXKX6OBANCNFSM6AAAAAAZCOYDOI . You are receiving this because you commented.Message ID: @.***>

AjayAsnani commented 1 year ago

const offsetTop = section.offsetTop + 5;

Exact Where should i add this line

goktugfevzi commented 1 year ago

Of course my screen size different, everyone has different size.

I made the component myself, I didn't use a ready-made library, so I solved this error this way, but you should use it with offset variable in react-scroll library.

AjayAsnani commented 1 year ago

Ya I tried adding that line but it gives me different error

goktugfevzi commented 1 year ago

Sir, if you want you can use my navbar codes

https://github.com/goktugfevzi/Personal-Portfolio/blob/main/src/components/nav/Nav.jsx

I solved this issue with 43. Line. You can see how I do it. I didnt use any library for navbar