ConnorsFan Posted February 7, 2016 Share Posted February 7, 2016 Hi, I am trying to use the GUISlider element (from CastorGUI) in my Babylon game. It works well in Firefox, Chrome, and Opera. In IE11 however, the callback function is never called. In the source code of the slider (GUISlider.js), I see that the "oninput" event of the range control is monitored. According to this reference (http://www.impressivewebs.com/onchange-vs-oninput-for-range-sliders/), there is an issue with that event for the range element in IE; it is also observed that the onchange event is triggered in IE like oninput is triggered in other browsers. So, for the moment, I use this kind of code as a workaround: var sliderControl1 = new CASTORGUI.GUISlider('sliderControl1', { x: 100, y: 100, w: 240, h: 24, min: 0, max: 100, step: 1, value: 50 }, guisystem, function () { console.log('value: ' + this.value); }); var slider1 = document.getElementById('sliderControl1'); slider1.onchange = slider1.oninput; When moving the slider thumb and releasing it, the very last change of value is triggered twice in non-IE browsers but that may not be a big problem (it is not for me), especially since the oninput event itself can be triggered several times for the same value, even without my workaround code. Is it possible to make the correction to the CastorGUI library? Or to make another correction that would allow the control to work in IE? Thanks! Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 8, 2016 Share Posted February 8, 2016 Hi, I send the fix. I add onchange in case oninput does not. ConnorsFan 1 Quote Link to comment Share on other sites More sharing options...
ConnorsFan Posted February 8, 2016 Author Share Posted February 8, 2016 Thanks for the quick correction! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.