Tagged: x
-
AuthorPosts
-
August 25, 2016 at 11:18 am #1146851
Im working with the following code for a floating button which is almost there. I need this to go to a URL, and i want it to hide it under smaller mobile screens b/c it covers my content in top the bar. Can you please assist. I did a lot of searching in forum and this is the closest I was able to get
jQuery(document).ready(function($) { $('<a ref="URL GOES HERE" class="floating-button x-btn x-btn-flat">Button Text</a>').appendTo('.site'); });
.site .floating-button { } .floating-button { position: fixed; top: 2%; right: 20px; z-index: 2000;
August 25, 2016 at 2:45 pm #1147121Hi there,
Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.
August 26, 2016 at 9:43 am #1148275here’s the URL
http://wordpress-17173-37579-139454.cloudwaysapps.com/August 26, 2016 at 12:34 pm #1148536Hi again,
To hide the button in smaller screens just add the following code in your Customizer via Appearance > Customize > Custom > Edit Global CSS:
@media screen and (max-width: 979px){ .floating-button { display: none; } }
Let us know how this goes!
August 27, 2016 at 12:33 pm #1149799Hi, thanks for the reply. I added the code above but it’s still showing in mobile. It’s not hiding. Please advise.
August 27, 2016 at 8:36 pm #1150097Hello There,
Thanks for the updates! Please update your JS code and use this instead:
jQuery(document).ready(function($) { var W = $(window).width(); if ( W > 979 ){ $('<a ref="/plan-your-event" class="floating-button x-btn x-btn-flat">PLAN YOUR EVENT</a>').appendTo('.site'); } });
We would loved to know if this has work for you. Thank you.
-
AuthorPosts