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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:00:55+00:00 2026-05-28T11:00:55+00:00

Now I know what you guys were thinking when you read the title. Your

  • 0

Now I know what you guys were thinking when you read the title. Your probable thinking that im talking about jQuery UI draggable. But im actually talking about the plugin i’m making for the community. I am trying to create a target for my plugin. It works as you can see here:

http://jsfiddle.net/XvZLn/24/

As you can see it works fine.

First, let me explain whats suppose to happen. Well what I want, is if the element is dropped in the target…the targ.on() gets launched. This is the onTarget feature in my plugin. This and the offTarget(targ.off()) are not working in my plugin.

This is what I have in my plugin:

var targ = {
                            on: o.target.onTarget,
                            off: o.target.offTarget
                        };

Then my plugin setup code is:

$(document).ready(function() {
    $('#drag').jDrag({
        revert: false,
        revertDuration: 500,
        ghostDrop: false,
        ghostRevert: false,
        ghostOpacity: '0.50',
        instantGhost: false,
        activeClass: false,
        handle: false,
        grid: false,
        cookies: false,
        cookieExdate: 365,
        radialDrag: false,
        radius: 100,
        circularOutline: false,
        strictMovement: false,
        distance: 0,
        not: false,
        containment: false,
        target: {
            init: '#container',
            lock: false,
            onTarget: function() {
                $(this).hide();
            },
            offTarget: function() {}
        },
        onPickUp: function() {},
        onDrop: function() {}
    });
});

I don’t see why it wont work.

This is my actually plugin if you want to take a look in it:

http://jsfiddle.net/ZDUZL/89/

  • 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-28T11:00:56+00:00Added an answer on May 28, 2026 at 11:00 am

    Try:

    onTarget: function() {
                    console.log(this);
                    $(this).hide();
                },
    

    You’ll see that “this” isn’t referring to the element, but rather the object that holds the function.

    Pass the element as an argument:

    if (locker === false) {
        if (statement) {
            targ.on(this);
            lock = false;
        } else {
            targ.off();
            lock = false;
        }
    }
    

    http://jsfiddle.net/ZDUZL/91/

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

Sidebar

Related Questions

Now i know that this one is actually not a very technical question but
I now its still early but I also know you guys are on top
So, I now know what to save from nightly builds . What about when
Now I know about the normal CSS list styles (roman, latin, etc) and certainly
Now I know that bigint is 2^64; that is, more atoms than there are
Now i know to use the method of float.Parse but have bumped into a
So I know now that the debug assemblies have been intentionally left out of
Language Integrated Query. Now I know that the acronyms are. I have seen C#
I know you guys hate helping with homework, but I thought I might ask
I'm trying to build my own prediction market, and I'm thinking about algorithms. That

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.