locked
How to make a drag event on javascript!

    Question

  • I'm making textbox like MS-word.

    I have trouble with making drag event in textarea.

    I want to make this function on this textarea.

    -when a part of the text is dragged, some information box become visible.

    (function () {
        "use strict"

        var appView = Windows.UI.ViewManagement.ApplicationView;
        var appViewState = Windows.UI.ViewManagement.ApplicationViewState;
        var nav = WinJS.Navigation;
        var ui = WinJS.UI;

        ui.Pages.define("/meetingTextPage/meetingTextPage.html", {

            ready: function (element, options) {
                var test = element.querySelector(".testSample");
                var textarea = document.getElementById('win-textarea');

                var text = textarea.value;
                

                textarea.addEventListener("drag", function () {  test.style.visibility = 'visible'; }, false);

            }
        });
    })();

    this is my javascript code. Please help us!


    Tuesday, September 25, 2012 2:12 PM

Answers

  • HI

    Drag-and-drop operations are not fully supported for Windows Store apps with JavaScript. Even so, we recommend that you use standard Accessible Rich Internet Applications (ARIA) markup to express drag-and-drop scenarios in your apps, including the ariaGrabbed andariaDropeffect attributes. That way, those scenarios will be fully accessible to screen readers or future versions of Windows that might support drag-and-drop operations.

    And also use html5 drag is a choice

    http://www.w3schools.com/html/html5_draganddrop.asp


    • Edited by Dino He Wednesday, September 26, 2012 7:51 AM
    • Marked as answer by Dino He Thursday, October 11, 2012 8:00 AM
    Wednesday, September 26, 2012 3:13 AM