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

  • Home
  • SEARCH
  • 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 9225497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:35:28+00:00 2026-06-18T04:35:28+00:00

I am currently designing an inline text editor. Users will have the ability to

  • 0

I am currently designing an inline text editor. Users will have the ability to drag and drop images into the editor anywhere they want.

The editor is entirely iFrame based, heavily relying on nested divs for styling and formatting. Now if I the user drags the image into the middle of the content and drops it there, I want that the content above the drop zone be packaged into one div, the image being placed below it, and the content below the drop zone packaged into another div and placed below the image.

But I have no idea how to split a div into two parts based on co-ordinates (which can be obtained from the jQuery drop handler). Can anyone give me an idea on how to do it?

  • 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-18T04:35:29+00:00Added an answer on June 18, 2026 at 4:35 am

    I think i get the gist of what you are trying to do and i made a short script to demonstrate one possibilty. I split the text into one div per character, and make those divs sortable so i can drag and drop position my image in the middle of the text

    HTML

    <span class="sortable">
           <img id="image" src="https://si0.twimg.com/profile_images/1842775519/profile_normal.png" />
            <input type="text" size="1" id="tb"/>
    </span>
    

    Javascript

    $(function () {
        $(".sortable").sortable();  //Makes panel sortable (needs jquery and jquery UI)
        $("#tb").keyup(function () { //binds keyup event on the input box
            $('<div>' + $(this).val() + '</div>').insertBefore(this);  //adds the input box value to a new div and inserts it into the DOM before the input box itself
            $(this).val(''); // empties the input
        });
    });
    

    CSS

    * {
        float:left
    }
    .sortable {
        border: solid 1px black;
        width:200px;
        float:left
    }
    

    see a working fiddle here
    http://jsfiddle.net/urbanbjorkman/cFfS9/1/

    This might be a bit of a mad hatter solution large chunks of text . And it still needs a lot of work (obviously since this is only a couple of lines of javascript)

    But it would not be inconcievable to keep the text in one div. And then to split it into separate elements on the sortstart event. And on the sortstop event join all connecting texts back together and leaving the image where it is. thus giving you what you asked for with a div split in two with the image inbetween.

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

Sidebar

Related Questions

I am currently designing a user control which will have other controls contained within
I am currently designing a web application that will allow users to schedule tasks
I'm currently designing Pac Man in java using swing. I have PNG images that
I am currently designing a class library that will provide data to a web
I am currently designing a role based authentication system for resources where many users
I'm currently designing an application which I will ultimately want to move to Windows
I am currently designing a public-facing C++ API for a product which will require
I'm currently designing a program that will involve some physics (nothing too fancy, a
I'm currently designing a database that has a table events that will be insert
I'm currently designing a DB scheme. I have to use hsqldb. - Normally 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.