Chloe9656 Posted May 28 Posted May 28 So I've created a floating banner that directs to WhatsApp with the Add block > Code widget. However, since the add block feature is not working on the cart page, I'd like to know if there are any ways to add this floating banner (like using JS?) throughout the website, not only on specific pages. Here's my code for the floating banner <style> /* floating banner */ .fltBanner2 { position: fixed; right: 30px; /* distance from left(px) */ top: 630px; /* distance from the top(px) */ display: inline; z-index: 999; } </style> <!-- 전화연락 --> <a href="https://api.whatsapp.com/message/TJOJYPO7OSXAM1?autoload=1&app_absent=0" class="fltBanner2" target="_blank"> <img src="https://cdn.imweb.me/upload/S2023092066b5f5a2d5be5/9c424c8d7901e.png" width="70px" height="70px"> </a>
Chloe9656 Posted May 30 Author Posted May 30 2 hours ago, david7u7 said: where did you insert your code? @david7u7 I used a code block and inserted the code in the regular pages except the cart and log in where I have a problem adding a code.
tuanphan Posted June 1 Posted June 1 Use this code to Website > Website Tools > Code Injection > Footer <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script> $(document).ready(function(){ $('<a href="https://api.whatsapp.com/message/TJOJYPO7OSXAM1?autoload=1&app_absent=0" class="fltBanner2" target="_blank"><img src="https://cdn.imweb.me/upload/S2023092066b5f5a2d5be5/9c424c8d7901e.png" width="70px" height="70px"></a>').appendTo('body#cart'); }); </script> <style> /* floating banner */ .fltBanner2 { position: fixed; right: 30px; /* distance from left(px) */ bottom: 10px; /* distance from the top(px) */ display: inline; z-index: 999; } </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!)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment