-
AuthorPosts
-
May 5, 2014 at 5:17 pm #260349
I have a Contact Form 7 contact form that opens in a light box … It is used any time there is a button to make contact with the site owner.
To accomplish this – I have created a custom CSS class button (that exactly match the theme’s buttons) to replace the standard theme button used in the Avia editor / widgets etc.
I can’t however seem to use this custom created button for the Promo Box … and I don’t really want to recreate the entire style of the Promo Box just for the button if possible – as this would make it somewhat confusing for the site owner to update in future (Avia is very simple and easy to use for them).
Is there some way to have the lightbox open via the Promo box setting (eg can I use the link section in the promotion box somehow)? Can I swap out some code / css somewhere to accomplish this? (note the button text is different for most promo box buttons).
Thanks!
May 7, 2014 at 5:35 am #261129Hi,
You can try mirroring a click (keeping both buttons on the Page would be needed), something like this at the end of js/avia.js:
jQuery(function() { jQuery(".promo_button").click(function(){ jQuery(".button_that_works").trigger("click"); }); });
Regards,
JosueMay 8, 2014 at 4:42 pm #261864HI Josue,
Thanks for taking the time to reply.
So are you saying I need to add that code to the end of the js/avia.js file?
May 8, 2014 at 8:42 pm #261982Hey!
Yes, but you’d need to change the classes according to the buttons you have.
Regards,
JosueJune 5, 2014 at 7:34 am #274970This reply has been marked as private.June 5, 2014 at 5:35 pm #275237Hi,
Can you post a link to the page where you are trying this? a screenshot noting where both buttons are would be helpful too.
Best regards,
JosueJune 5, 2014 at 5:49 pm #275243This reply has been marked as private.June 5, 2014 at 7:01 pm #275265Add this at the very end of your theme functions.php file:
function add_custom_script(){ ?> <script> jQuery(window).load(function(){ jQuery('.av_promobox .avia-button').on('click', function(e){ e.preventDefault(); jQuery('.cboxElement').trigger('click'); }); }); </script> <?php } add_action('wp_footer', 'add_custom_script');
Cheers!
Josue -
AuthorPosts
- You must be logged in to reply to this topic.