+ self.rootDiv = panelRoot;
+
+ $('*.panel-wrap:last', panelRoot).addClass('last-panel');
+
+ // Set panel widths from options.panelRatios
+ if (self.options && self.options.panelRatios) {
+ var totalWidth = 0;
+ $('.panel-wrap', panelRoot).each(function(index) {
+ var panelWidth = self.options.panelRatios[index] * panelRoot.width();
+ if ($(this).hasClass('last-panel')) {
+ $(this).css({
+ left: totalWidth,
+ right: 0,
+ });
+ } else {
+ $(this).css({
+ left: totalWidth,
+ width: panelWidth,
+ });
+ totalWidth += panelWidth;
+ }
+ });
+ }
+