Jump to content

Menu coding to force the "Book Now" button to appear on mobile menu header next to the logo

Recommended Posts

Site URL: https://www.meekermark.com

Hi. When viewing my site on a desktop, there is a BOOK A TOUR button that appears on the top right of the menu bar.  It is visible all the time.   This is a feature of the template I use.  But when viewing on a mobile device, this button is hidden inside the drop down menu.  There is open space in the menu bar on mobile and I want to force the button to appear there so that its visible all the time.  See the screenshots.   Can anyone help with this?  Happy to pay for this.

Screen Shot 2022-07-12 at 3.16.51 PM.png

Book tour button.jpg

Link to comment
  • Replies 8
  • Views 1.5k
  • Created
  • Last Reply

Top Posters In This Topic

Add to Settings > Advanced > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
  $(document).ready(function() { 
		$('<a href="/book-a-tour" class="tp-button">Book a tour</a>').insertBefore('.Mobile [data-nc-container="top-right"] button');
	});

</script>
<style>
  a.tp-button {
    border: 2px solid #c6c5b3;
    color: #c6c5b3;
    padding-left: 10px;
    padding-right: 10px;
}
</style>

image.png.3d4bbe1f2d01185af5d0baba7fc119f3.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 1 month later...

Hi there,

I have the same query as above, however when I paste this code on my site it doesn't work. I've changed the href to link to my url, but the button is still now showing. Updated code below. Is there any chance you can help me on this please?

This is my desktop view with the Book Online button.

image.png.e3aa275f0fcd1e4d183b41110cdb140b.png

And mobile view

image.png.a8ac4ecb40a92c011ea08ca7b6501c93.png

 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
  $(document).ready(function() { 
        $('<a href="/bookonline" class="tp-button">Book Online</a>').insertBefore('.Mobile [data-nc-container="top-right"] button');
    });

</script>
<style>
  a.tp-button {
    border: 2px solid #c6c5b3;
    color: #c6c5b3;
    padding-left: 10px;
    padding-right: 10px;
}
</style>

Link to comment
23 hours ago, Dee_Dublin said:

Hi there,

I have the same query as above, however when I paste this code on my site it doesn't work. I've changed the href to link to my url, but the button is still now showing. Updated code below. Is there any chance you can help me on this please?

This is my desktop view with the Book Online button.

image.png.e3aa275f0fcd1e4d183b41110cdb140b.png

And mobile view

image.png.a8ac4ecb40a92c011ea08ca7b6501c93.png

 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
  $(document).ready(function() { 
        $('<a href="/bookonline" class="tp-button">Book Online</a>').insertBefore('.Mobile [data-nc-container="top-right"] button');
    });

</script>
<style>
  a.tp-button {
    border: 2px solid #c6c5b3;
    color: #c6c5b3;
    padding-left: 10px;
    padding-right: 10px;
}
</style>

What is your site url? We can check easier

The code I sent for SS 7.0. It looks like your site is 7.1, will need a different code.

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 1 year later...
On 9/19/2023 at 2:39 AM, savvysocialite said:

Hi @tuanphan, can you help me with this as well? My website is https://lemon-flower-srp5.squarespace.com/config/pages (you just helped me on hamburger and logo orientation).

What is password?

image.png.36daebea6f4042bc37383ccef55fe87c.png

https://lemon-flower-srp5.squarespace.com/?noredirect

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 9/25/2023 at 12:55 AM, savvysocialite said:

@tuanphan the site password is: fivestars 

Don't remove any code in your current code. Add this to Custom CSS box

@media screen and (max-width:991px) {
.header-actions.header-actions--right {
    display: flex !important;
    position: relative;
}

.header-actions-action.header-actions-action--cta {
    display: flex !important;
    position: relative;
}

.header-title-nav-wrapper {
    flex: 1 0 60% !important;
}
}

image.png.1ef5914bb1550ce48fb2659c325599ef.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Thank you!

On 9/27/2023 at 2:09 AM, tuanphan said:

Don't remove any code in your current code. Add this to Custom CSS box

@media screen and (max-width:991px) {
.header-actions.header-actions--right {
    display: flex !important;
    position: relative;
}

.header-actions-action.header-actions-action--cta {
    display: flex !important;
    position: relative;
}

.header-title-nav-wrapper {
    flex: 1 0 60% !important;
}
}

image.png.1ef5914bb1550ce48fb2659c325599ef.png

 

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.