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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:22:25+00:00 2026-06-06T21:22:25+00:00

I am using Jquery ui functions and created Drag and Drop plugins. The all

  • 0

I am using Jquery ui functions and created Drag and Drop plugins. The all i have achieved is the draggable item and droppable area and implemented this successfully.

My next step is to drop my working plugins to be drop into the ckeditor body both source or design view.

i am using this code to make drag drop.

HTML

 <div class="item" id="image">
    <label class="title">Image</label>
    <label class="price"></label>
</div>
<div id="cart_items" class="back"></div>

JavaScript :

$("#cart_items").droppable({
            accept: ".item",
            //activeClass: "drop-active",
            //hoverClass: "drop-hover",
            drop: function(event, ui) {

            var coordsp=[];
            var coordsc=[];  
                var item        =   ui.draggable.html();
                var itemid      =   ui.draggable.attr("id"); 
                //alert(itemid);
                var coordsp     =   $('#cart_toolbar').position();

                var coordTopp   =   coordsp.top ;
                var coordLeftp  =   coordsp.left;
                //alert(itemid);
                var coordsc     =   $('#'+itemid).position();    

                //alert(coordsc.top);
                //alert(coordsc.left);
                var coordTopc   =   coordsc.top ;
                var coordLeftc  =   coordsc.left;
                var coordLeft   =   coordLeftc-coordLeftp;
                //var coordLeft   =   0;
                var coordTop    =   coordTopc-coordTopp;

                //numControls++;
                var numControls = document.getElementById('numControls');
                controls_count += 1; 
                numControls.value = controls_count; 
                count += 1;

                var hrml_sort_pre =  '<div class="column" id="column1">';


                if(itemid == "image")
                {
                    var html        =  '<div class="dragbox" id="item'+count+'"><img src="<?=base_url()?>/css/move_arrow.gif" alt="no-image" class="drag-image"><h2 id="'+count+'" value="para_1" onclick="do_collapse(this);" onmouseup="do_fill_data(this.id);" onmouseover="fetch_editor_data(this.id);" >&nbsp;</h2><div style="float:right;margin-top:-20px;margin-right:4px"><a  onclick="remove_item(\'item'+count+'\')" id="remove'+itemid+count+'" class="remove'+itemid+count+' x-button">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></div><div class="dragbox-content" ><div id="item_cart_'+count+'"  style="  position: relative; left: 0px; top:-2px;width:100%;">';
                                        html = html + '<a id="image_'+count+'" href="<?=base_url()?>index.php/media/index/'+count+'" ><img src="<?=base_url()?>images/na.jpg" id="temp_image_'+count+'" name="para_'+count+'" onclick="box_load(\'image_'+count+'\')" title = " " alt = ""  /></a><input type="hidden" name="control_type[]" value="image" /><input type="hidden" id="input_temp_image_'+count+'" name="content[]" value="" /> <input type="hidden" name="image-para[]" value="" /></div></div></div>';

                }
$("#cart_items").append(html); }}

Is there any way that we can use this to drop image html in editor and call some function on it.

Thanks in advance

  • 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-06T21:22:26+00:00Added an answer on June 6, 2026 at 9:22 pm

    You could create a CKEditor plugin that creates a button on the toolbar. This button would then inject the javascript, and then the markup for the drop area.

    However, I see a major problem with this kind of implementation. Be careful when putting script tags inside the CKEditor body, as CKEditor will most likely filter this out upon submit.

    Instead of creating a plugin which would inject the HTML into the body of the editor (thus creating multiple copies of the same code around the site), why not use a token, and then parse the token upon loading the content into the page?

    Here’s a couple of references for creating CKEditor plugins to help get you started:

    • CKEditor Plugin Development
    • Official CKEditor Plugin Creation Tutorial
    • The CKEditor Javascript API
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the Draggable/Droppable functionality of Jquery to allow drag-and-drop from a TreeView to
I've just started learning javascript and have created a drag and drop using jquery
I have a problem using multiple (2) jQuery plugins. I've googled a little but
i have a slider that scrolls on drag using the jquery UI however the
I recently ran into some troubles using JQuery Draggable and Resizable plugins. Looking for
I have a horizontal jquery-ui drag drop list contained in a wrapper in which
I'm experimenting with using jQuery toggle to move between two functions. The results so
As the title implies, I'm using jQuery's show and hide functions to hide and
I'm using a jQuery plugin that has its functions defined as such: $('#mydiv').pluginAction({ someproperty:
thus far i've only been using some basic jquery selectors and functions. but i'm

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.