Solved

Ajax draggable image (google maps style)

Posted on 2009-05-06
2
494 Views
Last Modified: 2012-06-21
Hi all,

I have a quick project that I'm doing for a relative.   The problem is... I know little (almost nothing) ajax - or javascript for that matter - but I'm more than willing to learn in the process.

He has several hi-res images that he would like to use for a website and he wants to display them in a small div in a website (let's say 600px by 400px) and use the same functionality of google maps where you can just drag the map - image in our case - to view the rest of the image that is not being displayed in the visible div.

I won't ask for any of you experts to write me a tutorial or the code to acomplish what we need - if you want to do such a thing well...  I won't complaint at all... LOL - What I actually need is for you to point me in the right direction.  

Should I try with Scriptaculous, Mootools, Jquery?

Which kind of effects from those libraries should I use?

Is there a script that already does that?

Or even better...  is there a plugin, extension or component for a CMS that does that and that we can use so he can actually update the contents of the site on his own?

We're probably going to use Wordpress,  and as far as I know there aren't any plugins to do this and I'm not sure if I can make it so that everytime he creates a new post or a new page in wordpress I could make any image displayed in this way automatically...  

But if you know of any other CMS that already has a plugin, extension or component that can provide us with this functionality we well be happy to give a try...  We haven't made a final decision on Wordpress so there's flexibility.

Thanks in advance for your help.
0
Comment
Question by:M-Geek
2 Comments
 
LVL 14

Accepted Solution

by:
ziffgone earned 500 total points
ID: 24331838
This one's cool. The demo uses extra large image files, not sure yours will be this big but here's a working script using the jQuery framework:

Development Page:
http://pupunzi.wordpress.com/2009/01/20/mbimgnavigator/

Demo Page:
http://www.open-lab.com/mb.ideas/index.html#mbImgNavigator

What I think is cool is you can navigate the image by dragging it or by dragging a little magnifier located in one of the corners of the container DIv. Also, upon double clicking the image, it resizes to fit in the container Div.

Uses the following scripts:

jquery:
http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.3.2.min.js

ui.core.js
http://jqueryui.com/download

Check the boxes for ui.core and draggable.



Pretty snaggy!

Regards...
0
 
LVL 1

Author Closing Comment

by:M-Geek
ID: 31578850
Thank you very much!

While I don't need the small navigator box at the bottom of the image this has definitely pointed me in the correct direction.  I'm now learning anything there's to know about the draggable effect in jquery.

Thanks for taking the time to answer my question.

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
html form to write data to csv 24 114
Magento slider issue 1 17
jQuery - how can I set focus to first valid element in dropdown? 2 20
Python - desktop use 1 32
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question