Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6472897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:24:02+00:00 2026-05-25T06:24:02+00:00

Use case: User clicks a link, a modal window is displayed containing one big

  • 0

Use case:

User clicks a link, a modal window is displayed containing one big image, scaled down to fit this window. When the user scrolls their mousewheel up or down, the image zooms in or out. The image is zoomed at whatever location the mouse cursor is pointing.

Problem:

I can’t wrap my brain around the how-to part of doing this.

Current workings:

When a link is clicked, a jQuery plugin creates a “viewer” collection of html elements that are styled with CSS. It’s an absolute positioned DIV that contains an IMG-element. The image is scaled to 100% width. When scrolling, the image is increased by 5% per scroll action.

Because the image is scaled up whilst zooming in, the containing DIV (overflow: hidden) will eventually clip the image. The image is draggable so that you can always see all parts of it.

Variables I keep and know:

The image’s scaled down ratio.
The image’s dimensions pre our most recent zoom action.
The image’s new dimensions after our most recent zoom action.
The difference in these two dimensions.
The X and Y position of the image.
The X and Y position of the mouse cursor, relative to the positioned container DIV.

What I probably need:

I know the variables I need, I just can’t grasp in what order to put them and what operators to use when. Math never was my strong suit, neither was grammar. So any help is appreciated.

Research done:

I Googled a lot for existing solutions. Most were implementations of OpenGL or Flash/ActionScript, none of which make any sense to me whatsoever. The few javascript-based examples I found were for commercial purposes, and even then their source code was obfuscated or minified, and I couldn’t quite extract the inner workings for this little feature properly.

Also, I probably don’t have the correct search words to figure it out, either.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:24:03+00:00Added an answer on May 25, 2026 at 6:24 am

    You could try to use an existing jQuery plugin, such as MapBox or GZoom:

    • http://wayfarerweb.com/jquery/plugins/mapbox
    • http://lab.gianiaz.com/jquery/gzoom

    Or you could try to roll your own. If you do this, there are a three pieces you’ll need to put together:

    1. Use javascript to scale the images in and out
      http://agilepartners.com/blog/2005/12/07/iphoto-image-resizing-using-javascript/
    2. Use javascript to allow you to pan the zoomed-in image
    3. Capture the scroll wheel movements in javascript
      http://www.switchonthecode.com/tutorials/javascript-tutorial-the-scroll-wheel
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the use case: A user clicks on a link that opens a window
Use case: user clicks the link on a webpage - boom! load of files
Use Case When a user goes to my website, they will be confronted with
I've got a use case where those indicators disturb the user interaction. Can I
Consider the following use case 1. User selects a product to purchase on seller's
I'm just starting to learn AspectJ, and I have use-case for say, User login.
I want to use a case statement in my user-defined functions because I need
In my app for a certain use case I create a new user (programmatically
Use case: A does something on his box and gots stuck. He asks B
Use case: 3rd party application wants to programatically monitor a text file being generated

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.