Jump to content

7.1 - Open menu on Hover vs. Click

Recommended Posts

Site URL: https://therosemountinn.squarespace.com/

I've adjusted the site's desktop menu so that it functions as if it were mobile (ie nav bar is hidden, then the menu expands and .header-menu overly is displayed when "Menu" is clicked).

However, I'd like to change the button onclick trigger to onmouseover, so that it opens when someone hovers over Menu, but I'm not well-versed enough in JS to be able to do so on my own.

 

Would appreciate any help - thank you!

Edited by MayaViolet
Hiding access to live site
Link to comment
On 12/7/2021 at 3:31 AM, MayaViolet said:

Site URL: https://therosemountinn.squarespace.com/

I've adjusted the site's desktop menu so that it functions as if it were mobile (ie nav bar is hidden, then the menu expands and .header-menu overly is displayed when "Menu" is clicked).

However, I'd like to change the button onclick trigger to onmouseover, so that it opens when someone hovers over Menu, but I'm not well-versed enough in JS to be able to do so on my own.

Website w/ password here.

 

Would appreciate any help - thank you!

So you need the side menu to be expanded on hover?

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
6 hours ago, MayaViolet said:

Yes - Tuan Phan actually helped me out with some script code!

It 's good to know that

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
  • 1 year later...

Hey! What was the code from @tuanphan for this? TIA!

Sam Crawford | by Crawford.
 
Multi-award-winning Squarespace expert
 
💸 How I make $500k/year designing Squarespace websites: Watch the video
📱 Hire me to build your Squarespace website: calendly.com/bycrawford/call
 
Did my comment help? To help others benefit, leave a like and mark my answer as 'best'. This lets users scroll straight to the solution they need.
Link to comment
9 hours ago, bycrawford said:

Hey! What was the code from @tuanphan for this? TIA!

I believe it was the following? I actually have it not active on the client site because we developed a diff solution, and the code link I found in my email shows up with an error, so not sure what if this will work!

 

<!---Menu Hover-->
<script>
$('.header-burger').hover(function(){
    $('body').toggleClass("header--menu-open");
});
</script>
<!---END Menu Hover--->

 

Link to comment
7 hours ago, MayaViolet said:

I believe it was the following? I actually have it not active on the client site because we developed a diff solution, and the code link I found in my email shows up with an error, so not sure what if this will work!

 

<!---Menu Hover-->
<script>
$('.header-burger').hover(function(){
    $('body').toggleClass("header--menu-open");
});
</script>
<!---END Menu Hover--->

 

Thank you Alyssa!

It doesn't work for me either. @tuanphan - would you be able to take a look at this site for me please: https://www.lanmark.net/

And let me know whether we could do the hover effect for this burger menu?

Thank you 🙂

Sam Crawford | by Crawford.
 
Multi-award-winning Squarespace expert
 
💸 How I make $500k/year designing Squarespace websites: Watch the video
📱 Hire me to build your Squarespace website: calendly.com/bycrawford/call
 
Did my comment help? To help others benefit, leave a like and mark my answer as 'best'. This lets users scroll straight to the solution they need.
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.