ohhhgary Posted November 19 Posted November 19 Site URL: https://www.ohhhgary.com If possible I'd like to change then middle page navigation link ¯\_(ツ)_/¯ with an image.
Solution Lesum Posted November 19 Solution Posted November 19 @ohhhgary Hi! You can add this code under Website > Pages > Website Tools > Code Injection > Header. You've to replace the image URL in the code as well. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <script> $(document).ready(function () { const $secondNavAnchor = $('.main-nav ul li:nth-child(2) a'); // Add image url here const imageUrl = "https://images.squarespace-cdn.com/content/v1/5db7ce0cbe792566a205ef14/1572460848759-GPQTEQ966PD9GQ5V2ZV0/Screen%2BShot%2B2019-10-30%2Bat%2B11.39.56%2BAM.jpg?format=750w"; $secondNavAnchor.empty().append(`<img src="${imageUrl}" alt="Navigation Image">`); }); </script> <style> .main-nav ul li:nth-child(2) a img { width: 100px; height: auto; } </style> If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. Sam Web Developer & Digital Designer ☕ Did you find my contribution helpful? Buy me a coffee?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment