Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ondragover condition

    i have been searching the net to find a way to condition ondragover results by file type being dragged.

    Code:
    function doDragOver(event)
    {
    if(event.dataTransfer.types.contains('image/png')){ event.preventDefault(); }
    if(event.dataTransfer.types.contains('image/gif')){ event.preventDefault(); }
    if(event.dataTransfer.types.contains('image/jpg')){ event.preventDefault(); }
    if(event.dataTransfer.types.contains('image/jpeg')){ event.preventDefault(); }
    }
    this is waht i have been trying based on the ondragover documentation on the MDN network.

    i need preventDefault to be triggered if what i am dragging is an image from thee users hard drive and not triggered if the element is dragged from the browser. i can find no listing of type formats or even discovering file types for the dragged item on any network. I would greatly appreciate any help.
    ps. i have been stuck on this for three days now, i may be losing my mind
    Last edited by Dorky; 08-26-2011 at 06:35 PM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •