Dear support,
i open the contact form 7 in a popup window. (Jaust klick on “Jetzt anmelden”. Opening the form on mobile forces the page to scroll to the top. So you have to scroll down to see the form. Ist there a way to focus the form on mobile so that it is shown without scrolling down to the form?
Thanks for any help!
Hey dondela,
Thank you for the inquiry.
This same issue has been discussed in the following thread, where you can find the solution as well.
// https://kriesi.at/support/topic/lightbox-17/#post-1272842
Let us know if it helps.
Best regards,
Ismael
yes – but think of jQuery 3.5.1 : jQuery(window).load(function(){
is deprecated now.
You had to use instead: jQuery(window).on('load', function(){
or here in the code: Link
$(window).on('load', function(){
…
and if it is the syntax is:
(function($){
…
})(jQuery);
you can write every jQuery inside as $: ( f.e. $(‘body’) }
function av_open_inline_popup(){
?>
<script type="text/javascript">
(function($) {
$(window).on('load', function(){
$('.open-popup-link').addClass('no-scroll');
$('.open-popup-link').magnificPopup({
type:'inline',
midClick: true,
callbacks: {
beforeOpen: function () {
$('body').css("overflow-y", "hidden");
},
close: function() {
$('body').css("overflow-y", "auto");
},
},
});
});
})(jQuery);
</script>
<?php
}
add_action('wp_footer', 'av_open_inline_popup');