here goes a simple explanation, if you want to update the values of a diferent whell you need to pass the instance of the mobiscroll and call the method options$(function(){ var filtersMetrics = [{}]; var wheelPosMetrics = [] var wheelPosFunc1 = []; var wheelPosFunc = []; wheelPosMetrics[0] = "Connection"; wheelPosMetrics[1] = "Shared"; wheelPosMetrics[2] = "Deleted"; filtersMetrics[0]['Metrics']=wheelPosMetrics; wheelPosFunc1[0] = "Count"; wheelPosFunc[0] = "Count"; wheelPosFunc[1] = "Sum"; wheelPosFunc[2] = "Avg"; filtersMetrics[0]['Func']=wheelPosFunc1; var metricsScroller = $("#select").mobiscroll().scroller({ theme : 'android', display : 'inline', mode: 'scroller', wheels: filtersMetrics, rows: 3, 'onChange' : function(v, i , e){ if(v[0]==1){ filtersMetrics[0]['Func']=wheelPosFunc; metricsScroller.mobiscroll('option', 'wheels', filtersMetrics); }else{ filtersMetrics[0]['Func']=wheelPosFunc1; metricsScroller.mobiscroll('option', 'wheels', filtersMetrics); } } });});我使用了2.5版本 这篇关于变速轮功能如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
06-28 22:07