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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:43:58+00:00 2026-05-23T19:43:58+00:00

i have done drag and drop using with jquery. here i have issue that

  • 0

i have done drag and drop using with jquery. here i have issue that need to place the drag content(teacher1) into specific area.

jquery:

$(document).ready(function() {  

    //var a ='1';
    $(".list").draggable({
    helper: 'clone', 
    cursor: 'hand', 
    revert: true,
    drag: function(ev, ui) {    
        dragId = $(this).attr('id');        
        //alert(dragId);
/*      if (dragId==1) {
            dragClass = "drop1";
        }   
*/     /*else {
         alert('Hi');
       }*/
     }   
    });
    $(".drop1").droppable({
        accept: ".list",
        activeClass: 'drop-active',
        hoverClass: 'dropareahover',
        drop: function(ev, ui){
        //var dropDragId = ui.draggable.attr('id');
        //alert(dropDragId)
        var targetId = $(this).attr("id");
        $("#" + targetId).each(function() {         
        $(this).append(ui.draggable.text());                                          
       });
    },
    destroy: function(ev, ui) {
    }
 });      
});
</script>

Html:

<div class="draggable">
<ul>
<li class="list" id="1">Teacher1</li>
<li class="list" id="2">Teacher2</li>
<li class="list" id="3">Teacher3</li>
<li class="list" id="4">Teacher4</li>
</ul>
</div>
<div class="drop">
<table class="tble">
<tr>
    <td id="td1" class="drop1 br">Vocational</td>
    <td id="td2" class="drop br">English<br /></td>
    <td id="td3" class="drop1 br">Mathematics<br /></td>
    <td id="td4" class="drop br">French<br /></td>
</tr>
<tr>
    <td id="td1a" class="drop br">Hindi</td>
    <td id="td2a" class="drop br">Science<br /></td>
    <td id="td3a" class="drop br">PTE<br /></td>
    <td id="td4a" class="drop br">Social Science<br /></td>
</tr>
</table>
</div>

css:

<style type="text/css">
.draggable {
  width:400px;
  height:auto;
  border:solid 1px #ccc;
}
.dropareahover {
  background-color:#EFD2A4;
  border-color:#DFA853;
}
.drop-active {
 background: #ffff99;
}

.draggable ul {
margin:0px;
padding:0px;
}
.draggable ul li {
list-style-type:none;
}
.drop {
width:400px;
height:auto;
margin:10px 0px 0px 0px;
border:solid 1px #ccc;
}
.drop1 {
border:solid 1px #CCCCCC;
width:100px;
}
.drop ul {
margin:0px;
padding:0px;
}
.drop ul li {
list-style-type:none;
}
.tble{border-collapse:collapse;}
.tble td{text-align:center;}
</style>

i need to place the drag content(teacher1) and drop into vocational and hindi, but not in mathematics. Again drag the teacher2 content and drop into english, but not other cell.

i have done somework. but i can’t able place the teacher2 into specific area. please help me out.

  • 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-23T19:43:59+00:00Added an answer on May 23, 2026 at 7:43 pm

    As far as I understand you need to create a different drop area for each filter

    with http://jqueryui.com/demos/droppable/#accepted-elements you can create 4 drop areas and each one accept a special class.

    hindu accepts only those with “.hindu”

    PTE accepts only those with “.PTE”

    I hope this helps

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

Sidebar

Related Questions

I want to do a simple drag-drop using jQuery. I have not done anything
I have done a bit of research into this and it seems that the
To handle Drag-n-Drop have done following, -(void)InitMyOutlineView{ - - - - - - -
I currently have a Rails Apps that lets users drag and drop certain elements
Greetings, I need to be able to drag and drop items that's contained in
I have done jQuery and Ajax, but I am not able to get the
I could have sworn i have done this somewhere - im using 2.0 right
I have done this using javascript for the edit bug page, where I used
I have done Java and JSP programming in the past, but I am new
I have done a bit of testing on this myself (During the server side

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.