Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/379.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript IE在Iframe窗口外释放时一直按住鼠标/触摸键_Javascript_Css_Html_Internet Explorer_Iframe - Fatal编程技术网

Javascript IE在Iframe窗口外释放时一直按住鼠标/触摸键

Javascript IE在Iframe窗口外释放时一直按住鼠标/触摸键,javascript,css,html,internet-explorer,iframe,Javascript,Css,Html,Internet Explorer,Iframe,我已经寻找答案好几天了,但都没有结果。我正在制作这个Cordova应用程序,在IE中,我需要在IFrame中运行所有不安全的网络内容。到目前为止,一切都进展顺利,但我在Firefox和Chrome中的InternetExplorer11到9和WindowsPhone8.1IE上遇到了问题 当我在IFrame内按下鼠标左键并将其拖动到IFrame外并释放时,我可以再次在IFrame内移动鼠标,但它仍然认为我的鼠标左键已按下。使用触摸控制时也会发生这种情况,使问题变得更加严重 我有一个小提琴的例子来

我已经寻找答案好几天了,但都没有结果。我正在制作这个Cordova应用程序,在IE中,我需要在IFrame中运行所有不安全的网络内容。到目前为止,一切都进展顺利,但我在Firefox和Chrome中的InternetExplorer11到9和WindowsPhone8.1IE上遇到了问题

当我在IFrame内按下鼠标左键并将其拖动到IFrame外并释放时,我可以再次在IFrame内移动鼠标,但它仍然认为我的鼠标左键已按下。使用触摸控制时也会发生这种情况,使问题变得更加严重

我有一个小提琴的例子来说明这个问题。尝试将地图拖动到Fiddle IFrame释放外,然后移回地图,以确认鼠标/触摸仍处于按下状态。

提前谢谢。我很难调试这个问题,但我怀疑是某个鼠标/触摸事件没有被触发

<div id="mapdisplay" style="width: 500px; height: 400px; background: grey" />

<script>

$(function() {
/**
* Moves the map to display over Berlin
*
* @param  {H.Map} map      A HERE Map instance within the application
*/



function moveMapToBerlin(map) {
    map.setCenter({ lat: 52.5159, lng: 13.3777 });
    map.setZoom(14);
}

/**
* Boilerplate map initialization code starts below:
*/

//Step 1: initialize communication with the platform

var platform = new H.service.Platform({
    app_id: '32pgIHkvuyWtWbBM7LhF',
    app_code: 'fpwF_cWgzvckmNL12RchNg',
    useCIT: true
});
var defaultLayers = platform.createDefaultLayers();

//Step 2: initialize a map  - not specificing a location will give a whole world view.

var map = new H.Map(document.getElementById('mapdisplay'),
  defaultLayers.normal.map);

//Step 3: make the map interactive
// MapEvents enables the event system
// Behavior implements default interactions for pan/zoom (also on mobile touch environments)
var behavior = new H.mapevents.Behavior(new H.mapevents.MapEvents(map));

// Create the default UI components
var ui = H.ui.UI.createDefault(map, defaultLayers);

// Now use the map as required...
moveMapToBerlin(map);

});

<script/>

$(函数(){
/**
*将地图移动到柏林上空显示
*
*@param{H.Map}在应用程序中映射一个HERE映射实例
*/
函数moveMapToBerlin(映射){
地图设置中心({lat:52.5159,lng:13.3777});
map.setZoom(14);
}
/**
*样板图初始化代码从下面开始:
*/
//步骤1:初始化与平台的通信
var平台=新的H.service.platform({
应用程序id:'32pgIHkvuyWtWbBM7LhF',
应用程序代码:“fpwF\U cWgzvckmNL12RchNg”,
乌塞西特:没错
});
var defaultLayers=platform.createDefaultLayers();
//第2步:初始化地图-不指定位置将提供全世界视图。
var map=new H.map(document.getElementById('mapdisplay'),
defaultLayers.normal.map);
//步骤3:使地图具有交互性
//MapEvents启用事件系统
//行为实现了平移/缩放的默认交互(也在移动触摸环境中)
var behavior=newh.mapevents.behavior(newh.mapevents.mapevents(map));
//创建默认的UI组件
var ui=H.ui.ui.createDefault(映射,默认层);
//现在根据需要使用地图。。。
moveMapToBerlin(地图);
});

我使用Internet Explorer 11(11.0.9600.17501)进行测试,但它工作正常。奇怪的是,我使用IE 11(11.0.9600.17631),在模拟IE 10时也会发生这种情况。等等,你把它一直拖到小提琴结果窗口外了吗?没有,就在地图的右边。我刚在另一台电脑上试过,问题也在那里。要测试此问题,您需要将其拖动到Fiddle结果窗口之外,因为结果窗口本身是一个IFrame。