-
AuthorPosts
-
February 17, 2015 at 8:52 am #208497
This is the code that I am trying to use in the customizer to disable/enable the auto scrolling feature in Google maps when the user clicks. I would not prefer creating a child theme for this.
jQuery(document).ready(function($) { $('#googleMaps').toggle(function() { $(this).css("pointer-events","all"); }); })
I appreciate your support!
February 17, 2015 at 11:11 am #208637Hi There,
Thanks for writing in!
You can try adding your jquery code in your Customizer’s Custom Javascript:
$('#googleMaps').toggle(function() { $(this).css("pointer-events","all"); });
Hope it helps!
Thanks!
February 18, 2015 at 3:44 am #209080Hey,
I did. It is not working.
February 18, 2015 at 8:50 am #209266Hi there,
Could you please try implementing the solution here (https://theme.co/x/member/forums/topic/scrollwheel-engaging-google-maps-embed/#post-23549).
If that doesn’t help, please provide us with a URL to your page.
Thanks!
February 18, 2015 at 11:32 am #209395I did even with the classic map embed. However here is the URL: bistro-e.com
February 18, 2015 at 5:10 pm #209663Hi there,
Thanks for writing in.
I can’t drag or zoom your map which I think is what you’re trying to do? So not sure why still need to do that. Your iframe contains draggable that is set to false, which is okay I think.
As for jQuery, please note that in wordpress, it should be jQuery and not $. Or wrap your code just like this.
jQuery ( function($) () { $('#googleMaps').toggle(function() { $(this).css("pointer-events","all"); }); } );
Hope this helps.
February 20, 2015 at 10:57 am #211148The above code did not work. You used extra () in the function. The proper code should be:
jQuery(function($){ $('#googleMaps').click(function() { alert('This is nice.') }); });
Except this does not work either. Anyway, I can set an option to the map object, as in the Maps API docs, or pass a perameter to the iframe. I currently have pointer events set to none however I do not think that us user friendly.
February 21, 2015 at 1:17 am #211581Hi There,
Thanks for writing again!
I’m sorry to hear that you’re still having this issue.You can add the pointer-events attribute to the element using Custom CSS & try that if it works.
Please add the following CSS in your Appearance > Customize > Custom > CSS and check again.div#gmap_canvas iframe { pointer-events: all; }
Hope it helps, thanks!
February 21, 2015 at 10:29 pm #212001Hey,
Thanks for your reply. How will it solve the auto scrolling on the map though?
February 22, 2015 at 7:24 am #212203Hi There,
Try adding following Javascript under Appearance > Customize > Custom > Javascript:jQuery(document).ready(function($) { $(window).scroll(function() { $('div#gmap_canvas iframe').css('pointer-events', 'none'); }); });
Hope it helps.
-
AuthorPosts