Floater on certain pages
Wed Mar 27 2024 08:48:33 GMT+0000 (Coordinated Universal Time)
Saved by @Shira
<!-------- // -------- FareHarbor Lightframe API and Floating Book Now Button -------- // --------> <script src="https://fareharbor.com/embeds/api/v1/?autolightframe=yes"></script> <!-- Fareharbor floating button on specific pages only --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(document).ready(function(){ var allowedPages = [ "https://chateaufeely.com/visits/feely-organic-wine-tours-options/", "https://chateaufeely.com/visits/", "https://chateaufeely.com/visits/courtes/", "https://chateaufeely.com/visits/half-day/", "https://chateaufeely.com/visits/day-tours/", "https://chateaufeely.com/fr/visites/", "https://chateaufeely.com/fr/visites/courtes/", "https://chateaufeely.com/fr/visites/demie-journee/", "https://chateaufeely.com/fr/visites/journee/" ]; function isAllowedPage() { var currentPage = window.location.href; return allowedPages.includes(currentPage); } if(isAllowedPage()) { var buttonText; if (window.location.href.includes("/fr/")) { buttonText = "RÉSERVEZ"; } else { buttonText = "BOOK NOW"; } var buttonDesktop = $('<a>', { href: "https://fareharbor.com/embeds/book/chateaufeely/?full-items=yes", text: buttonText, class: "fh-hide--mobile fh-font--inherit fh-color--white fh-fixed--side fh-icon--cal fh-button-true-flat-color", style: "font-weight:bold !important; letter-spacing: .7px !important; border-radius: 3px !important; box-shadow:none !important; transform:rotate(0deg) !important; margin-top: 8em !important; padding: .5em 1.4em .3em 1.4em !important;" }); var buttonMobile = $('<a>', { href: "https://fareharbor.com/embeds/book/chateaufeely/?full-items=yes", text: buttonText, class: "fh-hide--desktop fh-size--small fh-fixed--side fh-button-true-flat-color fh-color--white", style: "font-family: !important; font-weight:bold !important; letter-spacing: .7px !important; box-shadow:none !important; padding: 0em 2em !important;" }); $('body').append(buttonDesktop); $('body').append(buttonMobile); } }); </script>
Comments