I load a local HTML file into an IFrame using HTML / Javascript in the Windows Store development (Windows 8). I am trying to get a Swipe event from an iframe.
I tried with this pattern and this . I applied a mouse script that contains one div element. For Iframe, this does not work.
My code is:
<body>
<iframe id="iframe_Id" src="split.html" style="height:768px; width:1366px;" onload="Load();"></iframe>
</body>
function Load() {
var elt = document.getElementById("iframe_Id");
elt.style.backgroundColor = "#f3f3f3";
var gobj = new MSGesture();
gobj.target = elt;
elt.gesture = gobj;
elt.gesture.pointerType = null;
elt.addEventListener("MSPointerDown", onPointerDown, false);
elt.addEventListener("MSGestureTap", onTap, false);
elt.addEventListener("MSGestureHold", onHold, false);
elt.addEventListener("MSGestureChange", onGestureChange, false);
elt.addEventListener("MSGestureEnd", onGestureEnd, false);
}
function onPointerDown(e) {
var content = document.getElementById("iframe_Id");
}
I created functions for all events. But when the swipe in my IFrame the event did not go up. I structured here. I need to work with Swipe. Please help me out of this.
Kumar source
share