Detect Swipe gesture from iframe


  •    I am loading local HTML file in IFrame using HTML/Javascript in windows store development(Windows 8). I am trying get Swipe event from Iframe.

    I tried with this sample & this. I fallowed the Mouse wheel scenario which contains one div element.
    For Iframe it doesn't work.

    My code:

            <iframe  id="iframe_Id" src="split.html" style="height:768px; width:1366px;" onload="Load();"></iframe>
    function Load() {
        var elt = document.getElementById("iframe_Id");
        elt.style.backgroundColor = "#f3f3f3";
        var gobj = new MSGesture();
        // Defining gesture object for Pen, mouse and touch
        gobj.target = elt;
        elt.gesture = gobj;
        elt.gesture.pointerType = null;
        // Creating event listeners for gesture elements
        elt.addEventListener("MSPointerDown", onPointerDown, false);
        elt.addEventListener("MSGestureTap", onTap, false);
        elt.addEventListener("MSGestureHold", onHold, false);
        elt.addEventListener("MSGestureChange", onGestureChange, false);
        // Mouse Wheel does not generate onPointerUp
        elt.addEventListener("MSGestureEnd", onGestureEnd, false);
    function onPointerDown(e) { 
     var content = document.getElementById("iframe_Id");

     I created functions for all the events. But when swipe in my IFrame the event not raised.
      I structured here. I need to work with Swipe.  Please help me to out from this.


    • Edited by GDEVENDRAK Wednesday, October 30, 2013 1:18 PM
    Tuesday, October 29, 2013 9:54 AM

All replies

  • Is any one tried this or any one familiar with this... 
    Please suggest me. Bcz it is minimum requirement for me.

    Thanks in advance.


    Wednesday, October 30, 2013 1:18 PM
  • AFAIK, the swipe event is removed on windows8.1
    Thursday, October 31, 2013 3:06 AM

  • @yf liu 

    Thanks for reply.

    "swipe event removed " means..

     For every control or for Iframe.
    DO you have any source link to describe about this. 


    Thursday, October 31, 2013 3:12 AM
  • I'm sorry, it's not related to your problem i think. I mean the swipe operation in ListView.
    Friday, November 01, 2013 9:08 AM

  • It's OK .. Do you aware about my case(for IFrame)


    Saturday, November 02, 2013 1:55 AM