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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:26:49+00:00 2026-06-09T02:26:49+00:00

I have been tinkering with drag and drop in Google Closure libraries: http://closure-library.googlecode.com/svn/docs/class_goog_fx_DragDropGroup.html I

  • 0

I have been tinkering with drag and drop in Google Closure libraries:
http://closure-library.googlecode.com/svn/docs/class_goog_fx_DragDropGroup.html

I was wondering how to hide the cloned source element (that follows the cursor around) when the “dragstart” event is fired. Here is my current callback function for the dragstart event. I am sure that it is being called at the right time. However, it is failing at hiding the cloned element.

/**
 * Called when drag starts.
 * @param {Event} e The event signaling the start of drag.
 * @private
 */
Foo.prototype.dragStart_ = 
    function(e) {
  goog.style.setOpacity(e.dragSourceItem.element, 0);
  goog.style.showElement(e.dragSourceItem.element, false);
}

How do I hide the cloned source element that follows the mouse around? I don’t mind hiding the actual drag source element as well.

  • 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-09T02:26:51+00:00Added an answer on June 9, 2026 at 2:26 am

    Your event handler for dragstart should work if you remove the call to goog.style.showElement.

    /**
     * Called when drag starts.
     * @param {Event} e The event signaling the start of drag.
     * @private
     */
    Foo.prototype.dragStart_ = function(e) {
      goog.style.setOpacity(e.dragSourceItem.element, 0.0);
    };
    

    See the Drag & Drop Demos.

    In the demo file dragdrop.html the dragStart(event) function is defined as follows:

    function dragStart(event) {
      goog.style.setOpacity(event.dragSourceItem.element, 0.5);
    }
    

    Changing the opacity to 0.0 successfully hides both the source element as well as the drag element.

    To keep the source element visible and only hide the drag element, you can override goog.fx.AbstractDragDrop.prototype.createDragElement(sourceElement) and use CSS to set the opacity of the drag element. For example, in the dragdrop.html demo, button 1 uses a custom drag element styled with the CSS class foo. The following CSS hides the button 1 drag element:

    .foo {
      position: absolute;
      opacity: 0.0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been tinkering with javasript (jquery) all day. I want to create a
I have been tinkering with the jQuery autocomplete, and I got some parts of
I have been tinkering around with ServiceStack to expose some web services and have
I have a private project I've been tinkering with for a while. I'm thinking
I have been tinkering on NodeJS for a while now. I still don't seem
I am completely new to Batch files and have been tinkering around with simple
I have been working and tinkering with Nokogiri, REXML & Ruby for a month.
I have been tinkering around with PDF::API2 and i am facing a problem, create
Greetings stackoverflow. I have been tinkering about with a SOAP client using PHP5's native
I have a site at http://www.dellsvet.com/ which is being affected by a bug in

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.