The KPI Dashboard – Evolved
1-877-233-6149
Contact Us

Drag & Drop

Problem:

You want your Klip to respond to drag & drop events.

Solution:


To add drag & drop support to your Klip, first set a drop handler function in your onLoad() handler:

Klip.onDrop = myDrop;

Then create the drop handler function in your Klip. The drop handler function should have one parameter, which is the URL of the dropped object.

Here's an example drop handler function from the Bookmarks Klip:

function myDrop(url)
{
    if((url.indexOf("http://") != -1) || (url.indexOf("https://") != -1))
    {
        gBookmark.value = url;        
        Klip.requestRefresh();
    }
}

The function checks to make sure that the link contains either "http://" or "https://", then calls Klip.requestRefresh() to add the URL to the Klip.

Leave a Comment

To leave a comment, you must sign in or register (it's free).

   
Comment Type:
Title:
Comment: