Ask the community

This is a community support forum where you can ask
questions and interact with other PremiumPress Customers.

Google map – Disable Scrollwheel – Home Page Only

  • CodersPress.com
    CodersPress.com
    Elite Member 524 points
    June 27, 2014 at 8:58 am

    Here’s a little plugin for those that want to Disable the scrollwheel mouse action on your home page Google map.

    Just upload and activate – nothing special.

    Feel free to edit or improve the file.

    Attachments:
    You must be logged in to view attached files.
  • Alex Morgan
    Alex Morgan
    Super Guru 1,110 points
    June 27, 2014 at 9:24 am

    thanks for sharing :)

  • Raphael
    Raphael
    Newbie 43 points
    June 27, 2014 at 10:45 am

    Thank you for provide this solution! :)

    Maybe you know the code for this question?
    Thanks!

    Raphael

  • Gavin
    Gavin
    Newbie 13 points
    June 28, 2014 at 12:18 pm

    Excellent many thanks :)

    You can also add the zoom level to the map by editing via the Edit Plugins option:

    <?php
    /*
    Plugin Name: Home Page – Google map – Disable Scrollwheel
    Plugin URI:
    Description: To Disable Scrollwheel mouse action – Home Page Only
    Version: 1
    Updated: 27th June 2014
    Author: sMarty
    Author URI:
    License:
    */
    function home_page(){
    if ( is_home() ) {
    echo” <script>map.setOptions({‘zoom’:9,’scrollwheel’: false});</script>”;
    }
    }
    add_action(‘wp_footer’, ‘home_page’, 100);
    ?>

  • CodersPress.com
    CodersPress.com
    Elite Member 524 points
    June 28, 2014 at 1:24 pm

    Thanks for all the Thanks 😳 its really nothing.

    @Gavin… yeah I purposely left that out so it wouldn’t conflict with another plugin I’m working on.

  • Gavin
    Gavin
    Newbie 13 points
    June 28, 2014 at 4:23 pm

    Well I appreciate your plugin very much, as it was very annoying having scrolling maps.

    Any chance you could prevent the mobile version scrolling or even better add a Activate map button, similar to this: http://directory.cornish.co.uk (view on a mobile to see the Activate map button)

    Scrolling mobile maps are a serious pain….. :mrgreen:

  • CodersPress.com
    CodersPress.com
    Elite Member 524 points
    June 29, 2014 at 6:51 pm

    @Gavin hope you like it http://www.premiumpress.com/forums/topic/activate-deactivate-the-home-page-google-map-from-scrollingpc-draggingm/

    Deactivate the Google map – Disable Scrollwheel and use this instead

  • Michael
    Michael
    Senior Member 141 points
    July 13, 2014 at 4:43 pm

    This plugin has been deactivated because your changes resulted in a fatal error.

    Parse error: syntax error, unexpected ‘>’ in /home/autogoro/public_html/wp-content/plugins/disable_map_scrollwheel/homepage_disable_scrollwheel.php on line 14

  • Clive
    Clive
    Super Guru 1,818 points
    July 13, 2014 at 6:54 pm

    Excellent job M :)

  • Errol
    Errol
    Super Guru 2,708 points
    July 13, 2014 at 7:01 pm

    :)

Viewing 10 posts - 1 through 10 (of 10 total)