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 751801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:42:30+00:00 2026-05-14T14:42:30+00:00

this is just a quick probe to see if this is technically possible. I’m

  • 0

this is just a quick probe to see if this is technically possible.

I’m wanting to enable the resizing of an image in the browser (also within a contentEditable area). Firefox and IE already allow this to be done with their inbuilt handles and it works fine. I’m wanting to implement something for Safari however because it doesn’t support this natively.

I’ve had a go with jQuery’s resizable method and it does a very good job, however it relies on inserting a bunch of div’s along with the image and wrapping that in a big div. This would normally be fine if we weren’t concerned with the code generated in the contentEditable area, but we are because it’s going to be saved back to the server. I could strip this extra stuff out on save, but I was thinking, is it technically possible to create a resizing script for images that doesn’t rely on adding extra div’s? Even if we decide to go without handles for now, and just concentrate on detecting when a user is close to the edge of the image, change the mouse cursor to a resizing one, and detect clicks and drags in the 5px’s around the edge of the image, is this possible?

If it’s possible, I’m assuming (hoping) that perhaps it’s already been done, but my searching hasn’t turned up anything so far.

Keen to hear any ideas 🙂

  • 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-14T14:42:30+00:00Added an answer on May 14, 2026 at 2:42 pm

    Here’s the start of something perhaps. It is just in javascript, but you could easily bring it over to jQuery.

    PLEASE NOTE:

    The onmousedown and onmouseup would normally be on the image instead of the document, but since I don’t have any kind of handle, you just end up dragging the image itself (in Safari anyway).

    So the way it is right now, you need to click OUTSIDE the image in order to resize it.

    img {
        width: 400px;
        height: auto;
        position: relative;
    }
    
    var positionX;
    var startWidth;
    var image = document.getElementById('image');
    document.onmousedown = function(e) {
        if(!e) e = window.event;
        positionX = (e.clientX);
        startWidth = image.width;
        document.onmousemove = function(e) {
            if(!e) e = window.event;
            image.style.width = (startWidth + (e.clientX - positionX)) + 'px';
        }
    }
    document.onmouseup = function() {
        document.onmousemove = null;
        positionX = null;
        startWidth = null;
    }
    
    
    <img id="image" src="http://mydomain.com/myimage.jpg" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.