我正在使用ExtJS創建一個單滑塊,恰好在下拉菜單下。我注意到每次選擇拇指時,z-index都被設置爲10,000。這導致當菜單被打開了一個問題:ExtJS滑塊z-index問題
我有點找到了問題所在,並具有與Thumb.js
的topZIndex
物業辦。
Thumb.js:
onBeforeDragStart : function(e) {
if (this.disabled) {
return false;
} else {
this.slider.promoteThumb(this);
return true;
}
}
promoteThumb
去Multi.js(這可能是問題):
/**
* @private
* Moves the given thumb above all other by increasing its z-index. This is
* called when as drag any thumb, so that the thumb that was just dragged
* is always at the highest z-index. This is required when the thumbs are
* stacked on top of each other at one of the ends of the slider's
* range, which can result in the user not being able to move any of them.
* @param {Ext.slider.Thumb} topThumb The thumb to move to the top
*/
promoteThumb: function(topThumb) {
var thumbs = this.thumbs,
ln = thumbs.length,
zIndex, thumb, i;
for (i = 0; i < ln; i++) {
thumb = thumbs[i];
if (thumb == topThumb) {
thumb.bringToFront();
} else {
thumb.sendToBack();
}
}
}
通過增加移動上述所有其他給定的拇指它的Z指數似乎是問題。即使單個滑塊只有一個拇指,但此方法正在被調用。
我已經試過:中進入ExtJS的來源和改變topZIndex
短,我曾嘗試:
- 設置
topZIndex
爲0時,我產生滑動(沒有工作,因爲它不是有效的屬性) - 設置
style' property when I create the slider
風格:{z-index的: '0'}` 使用 '變' 監聽嘗試設置樣式:
change: function(slider, newValue, thumb, eOpts) { ... thumb.getEl().setStyle('z-index', '0'); slider.getEl().setStyle('z-index', '0'); //tried both of these }
問:有沒有辦法解決這個問題?這是ExtJS的錯誤嗎,因爲一個拇指不需要出現在另一個拇指上?