角不支持输入类型=“范围”,在IE10 [英] Angular doesn’t support input type=”range” in IE10

查看:132
本文介绍了角不支持输入类型=“范围”,在IE10的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当一个HTML5的价值<输入类型=范围> 元素在Chrome或Safari改变,棱角分明的检测更改。但在IE10(在Windows 8和Windows Server 2012和Windows Phone 8)的变化似乎在两个角1.0.6和V1.1.4忽略。火狐20.0.1不支持这种输入类型。

When the value of an HTML5 <input type="range"> element is changed in Chrome or Safari, angular detects the change. But in IE10 (on Windows 8, Windows Server 2012 and Windows Phone 8) the change seems to be ignored in both Angular v1.0.6 and v1.1.4. Firefox 20.0.1 doesn’t support this input type.

试试这两个(第三方着)小提琴,看看我的意思是: http://jsfiddle.net/fRgtF /
http://jsfiddle.net/mrajcok/nBd86/

Try these two (third-party authored) fiddles to see what I mean: http://jsfiddle.net/fRgtF/, http://jsfiddle.net/mrajcok/nBd86/.

我可以想像一对夫妇的快速修复,但因为我将使用这是在B2B方面的关键因素是稳定性,可靠性和易用性的长期维护。考虑到这一点,任何人都可以帮助这两个问题:

I can imagine a couple of quick fixes but as I’ll be using this is in a B2B context the key factors are stability, reliability and ease of long-term maintenance. With that in mind, can anyone help with these two questions:

(1)如果我想使用&LT;输入类型=范围&GT; 在IE10什么是让角度来检测输入值发生变化的正确方法?我不介意使用较低级别的角度函数来得到正确的结果。

(1) If I want to use <input type="range"> in IE10 what’s the correct way to get Angular to detect changes in the input value? I don’t mind using lower-level Angular functions to get the right result.

(2)如果我决定使用滑动范围的输入窗口小部件,而不是HTML5元素,做一件已经存在和/或是否有任何的出发点(最好SVG为导向的),这将显著帮助我建立我自己的?

(2) If I decide to use a sliding range input widget instead of the HTML5 element, does one already exist and/or are there any starting points (ideally svg-oriented) that would significantly help me build my own?

推荐答案

我有一个 .VAL()解决方法解决它:

I have solved it with a .val() workaround:

   var ranger = element.find("input");
   ranger.bind("change",function(){

      // console.log("changed! ", scope.zoom_level) // Not working

      scope.$apply(function(){
           scope.zoom_level = ranger.val();
      });
      console.log("changed! ", scope.zoom_level) // Now it does
   });

例如: http://jsfiddle.net/hRDVS/

这篇关于角不支持输入类型=“范围”,在IE10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆