Loading ...
Sorry, an error occurred while loading the content.

Problem about the fading of components during drag drop

Expand Messages
  • strikevin01
    Dear All, I am now going to have to same effect with My Yahoo! that on starting dragging a component, there will be a small icon near the cursor indicating if
    Message 1 of 1 , Aug 31, 2006
    • 0 Attachment
      Dear All,

      I am now going to have to same effect with My Yahoo! that on
      starting dragging a component, there will be a small icon near the
      cursor indicating if the target belongs to the same group with the
      dragging element.

      My Idea is to append a <img> tag to the dragging element, which is
      get by this.getDragEl() method. However, because the dragging
      element is set to opacity 50, I cannot make the img to be shown in
      opacity 100, seems all the childs inside the dragging <div> will be
      limited to a max opacity of 50. Would anyone know how to set the img
      to have opacity 100??

      The following is my code for doing the above scenario:

      dragEl = this.getDragEl();
      var dragStyle = dragEl.style;
      dragStyle.opacity = 0.5;
      dragStyle.filter = "alpha(opacity=50)";

      var img = document.createElement("img");
      img.id = "dragImg";
      img.src = "img/red.gif";
      img.style.top = this.mouseY-dragEl.offsetTop-10;
      img.style.left = this.mouseX-dragEl.offsetLeft+10;
      img.style.opacity = 0.9;
      img.style.filter = "alpha(opacity=90)";
      img.style.position = "absolute";
      dragEl.appendChild(img);

      Thank you all.

      Best Regards,
      Kevin Wong
    Your message has been successfully submitted and would be delivered to recipients shortly.