Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

pan and scan image using Jquery

Posted on 2011-03-23
1
Medium Priority
?
770 Views
Last Modified: 2012-05-11
Let’s say we have a 1000x1000px  image and we want to display 400x400px of that image in a web browser. I want the user to be able to use their mouse cursor to “scan around” the image and view different pieces of it.   Write a script using jQuery that will allow the user to do that.
0
Comment
Question by:stargateatlantis
1 Comment
 
LVL 3

Accepted Solution

by:
Maximus5684 earned 2000 total points
ID: 35201879
Use the jQuery UI plugin called Draggable:

http://jqueryui.com/demos/draggable/

Create a container that is the veiwport size that you want. Put the full-sized image inside that container and set the container to have overflow: hidden. Then, using jQuery, select the image and add $.draggable().
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

916 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