Not working Shortcodes in Header-Banner

I need to open a popup window with the contact form in the header-banner div. I put in a custom JS code and it is insert the shortcode but it is displayed as text.

JS CODE:

jQuery(function($){ $(document).ready(function() { $('body').append('xЗаказать обратный звонок[contact-form-7 id="2476" title="Заказать обратный звонок"]'); $('body').append(''); var boxWidth = 400; function centerBox() { /* Preliminary information */ var winWidth = $(window).width(); var winHeight = $(document).height(); var scrollPos = $(window).scrollTop(); /* auto scroll bug */ /* Calculate positions */ var disWidth = (winWidth - boxWidth) / 2 var disHeight = scrollPos + 150; /* Move stuff about */ $('.popup-box').css({'width' : boxWidth+'px', 'left' : disWidth+'px', 'top' : disHeight+'px'}); $('#blackout').css({'width' : winWidth+'px', 'height' : winHeight+'px'}); return false; } $(window).resize(centerBox); $(window).scroll(centerBox); centerBox(); $('[class*=popup-link]').click(function(e) { /* Prevent default actions */ e.preventDefault(); e.stopPropagation(); /* Get the id (the number appended to the end of the classes) */ var name = $(this).attr('class'); var id = name[name.length - 1]; var scrollPos = $(window).scrollTop(); /* Show the correct popup box, show the blackout and disable scrolling */ $('#popup-box-'+id).show(); $('#blackout').show(); $('html,body').css('overflow', 'hidden'); /* Fixes a bug in Firefox */ $('html').scrollTop(scrollPos); }); $('[class*=popup-box]').click(function(e) { /* Stop the link working normally on click if it's linked to a popup */ e.stopPropagation(); }); $('html').click(function() { var scrollPos = $(window).scrollTop(); /* Hide the popup and blackout when clicking outside the popup */ $('[id^=popup-box-]').hide(); $('#blackout').hide(); $("html,body").css("overflow","auto"); $('html').scrollTop(scrollPos); }); $('.close').click(function() { var scrollPos = $(window).scrollTop(); /* Similarly, hide the popup and blackout when the user clicks close */ $('[id^=popup-box-]').hide(); $('#blackout').hide(); $("html,body").css("overflow","auto"); $('html').scrollTop(scrollPos); }); }); });

Comments

Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.