سؤال

I'm using a YUI dial widget in a responsive page and trying to update the size of the dial after the screen has been resized so it always fits within its container.

I seem to be able to update the dial object's attributes (diameter, width, height, etc) but can't get the UI to update. Calling the render() and syncUI() methods doesn't seem to do anything.

Haven't really used YUI much before so maybe there's something obvious I'm missing!

هل كانت مفيدة؟

المحلول

For anyone that stumbles across this question, I managed to solve it. I wasn't using the proper set() method for the diameter before calling syncUI() method on the dial object. Here's the solution:

$(window).smartresize(function() {
  var diameter = $('#container').width();
  dial.set('diameter', diameter);
  dial.syncUI();
});
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top