pretesh Posted April 2, 2019 Share Posted April 2, 2019 On the W3Schools website page 'How TO - Shrink Navigation Menu on Scroll' tutorial it shows how to use Javascript to shrink the nav-bar. The 'CompanyLogo' also shrinks but this is text not an actual logo. What kind of Javascript would I need for a shrinking logo that was for example a jpg image? Is this a difficult thing to do? Any help on this would be great as I want to do this for my own website design and I'm new to Javascript. Link to comment Share on other sites More sharing options...
Funce Posted April 3, 2019 Share Posted April 3, 2019 Take a look at the Try-It. Can you see how its changing the 'logo'? https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_navbar_shrink_scroll I noticed that it uses JavaScript to directly change the font-size of the 'logo'. If you used an image you could change the width of the image to resize it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now