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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:19:32+00:00 2026-06-09T12:19:32+00:00

I’d like to be able to move an image and type in a div

  • 0

I’d like to be able to move an image and type in a div on the same screen, and have the text wrap around the image as it is being moved. So far I’ve been able to do this:

http://jsfiddle.net/uk6DA/

But when the image is moved, the text does not change its position. How might the text get readjusted as the image is moved?

  • 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-06-09T12:19:33+00:00Added an answer on June 9, 2026 at 12:19 pm

    I think this all has to do with placement within the DOM.

    If you’re serious about doing something like this, I think you’re going to have to find where the element sits when you move it, then change its place in the DOM based on that. You’ll probably want to put the text in an element too.

    So, in the beginning, #typer preceeds the text. But when you move it, you’re going to have to do a couple of things. You’ll have to see where the left and top edges of #typer sit, and what text they sit on top of. Then, you’ll have to make calculations to modify them within the DOM from there.

    I’m guessing you’ll either have to add a bunch of span‘s or div‘s to the text, to be able to recreate the text appropriately, to fit around the element. This would get a bit difficult too, because the lengths aren’t fixed, they’re dynamic. With the text inside a div or span, you won’t get the “wrap-around” to the side of the page, it will just fall down to the next line within that element.

    Initial Setup

    enter image description here

    After Movement

    enter image description here

    That should explain how you’re going to have to split them up. It may get pretty complicated, but you can do it. You’ll just have to mess with different types of measurements. I’ve done things very similar to this in the past.

    Basically, just keep track of where you split the text (that’s why they have the IDs in sequential order), so you can join them. Measure how much space the text takes up, how much space the image takes up, and how large the canvas area you can work with is.

    From there, you should have a pretty good gauge of what to do. Just make sure that your text doesn’t break to the next line if it overflows. If that happens, it’ll break and ruin the illusion.

    So, as far as placement in the DOM goes:

    Initial Setup

    <div id="typer">
        <img id="img" />
        <div class="text"> ..... </div>
    </div>
    

    After Movement

    <div id="typer">
        <div class="text" id="text1"> ... </div>
        <div class="text" id="text2"> ... </div>
        <div class="text" id="text4"> ... </div>
        <div class="text" id="text6"> ... </div>
        <div class="text" id="text8"> ... </div>
        <img id="img" />
        <div class="text" id="text3"> ... </div>
        <div class="text" id="text5"> ... </div>
        <div class="text" id="text7"> ... </div>
        <div class="text" id="text9"> ... </div>
        <div class="text" id="text10"> ... </div>
    </div>
    

    That’s going to be the “easiest” route to set it up for the CSS too, unless you position: absolute; everything, which can work too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a text area in my form which accepts all possible characters from
I have two tables with like below codes: Table: Accounts id | username |
I have a reasonable size flat file database of text documents mostly saved in
I have some data like this: 1 2 3 4 5 9 2 6
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I would like to count the length of a string with PHP. The string
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.