mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-03 04:14:42 +00:00
removed an unnecessary wrapper
This commit is contained in:
parent
71763d3dfa
commit
9a9d47e550
2 changed files with 11 additions and 15 deletions
|
|
@ -7,8 +7,7 @@ label.ui-slider { display: block; }
|
|||
input.ui-slider-input { display: inline-block; width: 40px; }
|
||||
select.ui-slider-switch { display: none; }
|
||||
div.ui-slider { position: relative; display: inline-block; overflow: visible; height: 15px; padding: 0; margin: 0 2% 0 15px; top: 4px; width: 66%; }
|
||||
div.ui-slider-handle { position: absolute; top: 50%; }
|
||||
a.ui-slider-handle-btn { position: absolute; z-index: 10; top: 50%; width: 24px; height: 24px; margin-top: -13px; margin-left: -13px; }
|
||||
a.ui-slider-handle { position: absolute; z-index: 10; top: 50%; width: 24px; height: 24px; margin-top: -13px; margin-left: -13px; }
|
||||
|
||||
@media screen and (min-width: 480px){
|
||||
label.ui-slider { display: inline-block; width: 20%; margin: 0 2% 0 0; }
|
||||
|
|
@ -24,9 +23,7 @@ div.ui-slider-switch div.ui-slider-labelbg-b { width: 60%; height: 100%; right:
|
|||
.ui-slider-switch-a div.ui-slider-labelbg-a, .ui-slider-switch-b div.ui-slider-labelbg-b { z-index: 1; }
|
||||
.ui-slider-switch-a div.ui-slider-labelbg-b, .ui-slider-switch-b div.ui-slider-labelbg-a { z-index: 10; }
|
||||
|
||||
|
||||
div.ui-slider-switch div.ui-slider-handle { width: 100%; z-index: 20; }
|
||||
div.ui-slider-switch a.ui-slider-handle-btn { width: 100%; height: 32px; margin-top: -18px; margin-left: -100%; }
|
||||
span.ui-slider-label { width: 100%; position: absolute;height: 32px; font-size: 16px; text-align: center; margin: -18px 0; line-height: 2; background: none; border-color: transparent; }
|
||||
span.ui-slider-label-a { left: -200%; margin-right: -2px }
|
||||
span.ui-slider-label-b { right: 0; margin-left: -2px }
|
||||
div.ui-slider-switch a.ui-slider-handle { z-index: 20; width: 100%; height: 32px; margin-top: -18px; margin-left: -100%; }
|
||||
span.ui-slider-label { width: 100%; position: absolute;height: 32px; font-size: 16px; text-align: center; line-height: 2; background: none; border-color: transparent; }
|
||||
span.ui-slider-label-a { left: -100%; margin-right: -2px }
|
||||
span.ui-slider-label-b { right: -100%; margin-left: -2px }
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ $.fn.slider = function(options){
|
|||
percent = val / (max - min) * 100,
|
||||
snappedPercent = percent,
|
||||
slider = $('<div class="ui-slider '+ selectClass +' ui-bar-c ui-btn-corner-all" role="application"></div>'),
|
||||
handle = $('<a href="#" class="ui-slider-handle-btn"></a>')
|
||||
handle = $('<a href="#" class="ui-slider-handle"></a>')
|
||||
.appendTo(slider)
|
||||
.buttonMarkup({corners: true, theme: 'c', shadow: true})
|
||||
.attr({
|
||||
|
|
@ -31,7 +31,6 @@ $.fn.slider = function(options){
|
|||
'title': val,
|
||||
'aria-labelledby': labelID
|
||||
}),
|
||||
handleWrapper = handle.wrap('<div class="ui-slider-handle"></div>').parent(),
|
||||
dragging = false;
|
||||
|
||||
if(cType == 'select'){
|
||||
|
|
@ -43,7 +42,7 @@ $.fn.slider = function(options){
|
|||
corners = (i==0) ? 'right' :'left',
|
||||
theme = (i==0) ?'c':'b';
|
||||
$('<div class="ui-slider-labelbg ui-slider-labelbg-'+ side +' ui-btn-down-'+ theme +' ui-btn-corner-'+ corners+'"></div>').prependTo(slider);
|
||||
$('<span class="ui-slider-label ui-slider-label-'+ side +' ui-btn-down-'+ theme +' ui-btn-corner-'+ corners+'" role="image">'+$(this).text()+'</span>').prependTo(handleWrapper);
|
||||
$('<span class="ui-slider-label ui-slider-label-'+ side +' ui-btn-down-'+ theme +' ui-btn-corner-'+ corners+'" role="image">'+$(this).text()+'</span>').prependTo(handle);
|
||||
});
|
||||
|
||||
}
|
||||
|
|
@ -81,7 +80,7 @@ $.fn.slider = function(options){
|
|||
|
||||
}
|
||||
snappedPercent = Math.round( newval / max * 100 );
|
||||
handleWrapper.css('left', percent + '%');
|
||||
handle.css('left', percent + '%');
|
||||
handle.attr({
|
||||
'aria-valuenow': (cType == 'input') ? newval : control.find('option').eq(newval).attr('value'),
|
||||
'aria-valuetext': (cType == 'input') ? newval : control.find('option').eq(newval).text(),
|
||||
|
|
@ -101,11 +100,11 @@ $.fn.slider = function(options){
|
|||
|
||||
function updateSnap(){
|
||||
if(cType == 'select'){
|
||||
handleWrapper
|
||||
handle
|
||||
.addClass('ui-slider-handle-snapping')
|
||||
.css('left', snappedPercent + '%')
|
||||
.animationComplete(function(){
|
||||
handleWrapper.removeClass('ui-slider-handle-snapping');
|
||||
handle.removeClass('ui-slider-handle-snapping');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -145,7 +144,7 @@ $.fn.slider = function(options){
|
|||
})
|
||||
.insertAfter(control);
|
||||
|
||||
handleWrapper
|
||||
handle
|
||||
.css('left', percent + '%')
|
||||
.bind('click', function(e){ return false; });
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue