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