Jump to content

Popup for link in announcement bar custom code

Recommended Posts

Hello,

I was wondering if there is some code that would allow me to create a pop-up for a link in the announcement bar (there are 3 links - only one would show a popup).

We want the popup to show when clicking the Financing Available link.

Attached is the image of what we would like. Passcode for website is 1234

Thanks!

Screenshot 2023-07-17 at 4.09.40 PM.png

Link to comment
  • Replies 14
  • Views 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

Please like and upvote if my comments were helpful to you. Cheers!

Zygmunt Spray
Squarespace Website Designer
Contact me: 
https://squarefortytwo.com 
Hire me on Upwork!

🔌 Ghost Squarespace Plugins (Referral link)
📈 SEO Space (Referral link)
 SquareWebsites Plugins (Referral link)
 🔲 SQSP Themes (Referral link) 
Spark Plugin (Referral link) 

 Did I help? Buy me a coffee?

Link to comment
21 hours ago, CaresaCreativeCo said:

The "financing available" link - thanks!

Add to Settings > Developer Tools > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
  jQuery(document).ready(function($){
  $('#announcement-bar-text-inner-id a[href*="#financ"]').click(function(){
  	$(' footer.sections section:first-child').addClass('show');
  });
    $('footer.sections section:first-child').click(function(){
    	$(this).removeClass('show');
    });
})
</script>
<style>
  footer.sections section:first-child {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 90%;
    z-index: 999999;
    visibility: hidden;
}
  .show {
  	visibility: visible !important;
  }
</style>

 

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
4 hours ago, tuanphan said:

Add to Settings > Developer Tools > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
  jQuery(document).ready(function($){
  $('#announcement-bar-text-inner-id a[href*="#financ"]').click(function(){
  	$(' footer.sections section:first-child').addClass('show');
  });
    $('footer.sections section:first-child').click(function(){
    	$(this).removeClass('show');
    });
})
</script>
<style>
  footer.sections section:first-child {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 90%;
    z-index: 999999;
    visibility: hidden;
}
  .show {
  	visibility: visible !important;
  }
</style>

 

This didn't work at all. Is it because I have several links in the announcement bar? 

Link to comment
  • 2 weeks later...
On 8/10/2023 at 3:20 AM, CaresaCreativeCo said:

Hello,

I did this and it still doesn't work.

Sorry, my code missing a space character

image.thumb.png.ca87d35c967cbbde9690de958da96c8e.png

Use this new code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
  jQuery(document).ready(function($){
  $('#announcement-bar-text-inner-id a[href*="#financ"]').click(function(){
  	$('footer.sections section:first-child').addClass('show');
  });
    $('footer.sections section:first-child').click(function(){
    	$(this).removeClass('show');
    });
})
</script>
<style>
  footer.sections section:first-child {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 90%;
    z-index: 999999;
    visibility: hidden;
}
  .show {
  	visibility: visible !important;
  }
</style>

 

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
  • 2 weeks later...
On 8/10/2023 at 10:51 PM, tuanphan said:

Sorry, my code missing a space character

image.thumb.png.ca87d35c967cbbde9690de958da96c8e.png

Use this new code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
  jQuery(document).ready(function($){
  $('#announcement-bar-text-inner-id a[href*="#financ"]').click(function(){
  	$('footer.sections section:first-child').addClass('show');
  });
    $('footer.sections section:first-child').click(function(){
    	$(this).removeClass('show');
    });
})
</script>
<style>
  footer.sections section:first-child {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 90%;
    z-index: 999999;
    visibility: hidden;
}
  .show {
  	visibility: visible !important;
  }
</style>

 

Hello,

It still isn't working. 

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.