How can I make the map draggable?

JQuery draggable google map

  • I have a div overlay with a gmap on it and have used a jquery plugin to make it draggable but when i try to use the pull and drag function on the map the whole div move. Any ideas how to fix this?

  • Answer:

    Just wrap the google map in another div and assign it a handle, here is the code and a working example. HTML : <div class="draggable"> <div id="handle">Handle</div> <iframe width="700px" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?q=108+S+4th+St,+Cabot,+AR+72023,+USA&amp;ie=UTF8&amp;ll=34.983948,-92.014875&amp;spn=0.012273,0.027122&amp;z=14&amp;iwloc=addr&amp;om=1&amp;output=embed&amp;s=AARTsJrKwkyz-ofBV3q5yi6SmToKlUCe8Q" style="height: 522px"></iframe> </div> Javascript : $(document).ready(function() { $('.draggable').draggable({'handle' : '#handle'}); }); Example : http://jsfiddle.net/semTg/

user803447 at Stack Overflow Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.