Jump to content

GUISlider - Change event not triggered in IE11


ConnorsFan
 Share

Recommended Posts

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!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...