JQuery Mobile Slider Handle(JSFiddle提供)

时间:2015-09-02 02:05:34

标签: jquery html css jquery-mobile

这是一个JSFiddle:

https://jsfiddle.net/vxee5b79/7/

HTML:

.ui-btn.ui-slider-handle {
    display: none;
}

CSS:

CREATE TABLE DATE_DATA(Date_Values FLOAT)
GO

INSERT INTO DATE_DATA VALUES (2012),(2013),(2014)
GO

-- Add a new column to your table 
ALTER TABLE DATE_DATA 
ADD New_Date_Value DATETIME;
GO

-- use an update statement to populate the new column
UPDATE DATE_DATA
 SET New_Date_Value = CAST(CAST(Date_Values AS VARCHAR(4)) + '0101' AS DATETIME)
GO

-- get rid of the old float column
ALTER TABLE DATE_DATA
DROP COLUMN Date_Values;
GO

-- finally rename the new column to old column name
sp_RENAME 'DATE_DATA.[New_Date_Value]' , 'Date_Values', 'COLUMN'
GO

我的问题是,当我添加上面的CSS时,它会按预期消除两个滑块上的滑块手柄。有没有办法在移除底部滑块上的手柄时保持顶部滑块上的手柄?

2 个答案:

答案 0 :(得分:1)

您可以使用更具体的选择器,如下所示:

.ui-slider-handle.ui-btn.ui-shadow.ui-btn-a {
display: none;

}

答案 1 :(得分:1)

简单的方法是将需要把手的任何滑块放在容器DIV中隐藏:

.hiddenHandle .ui-btn.ui-slider-handle {
    display: none;
}

然后CSS可以使用该类:

#slider-1 + .ui-slider-track .ui-btn.ui-slider-handle {
    display: none;
}
  

更新了 FIDDLE

如果您不想要容器,可以使用这样的CSS:

import re
def main():
    #Using "raw_input" instead of "input"
    name = raw_input('Enter your first name: ')

    print(name)

    ### print name with spaces in between characters
    spaces = ''
    for ch in name:
        spaces = spaces + ch + ' '
    print(spaces[:-1]) # to get rid of space after e

    print('name in caps is,',name.upper())  # print name in all caps

    print('After chopping the name we get',name[1:4])

    new_name=str_func(name)
    print(new_name)

def str_func(value):
    #re is regular expression module. It will match string "Guido" and re.IGNORECASE makes it case insensitive.
    #When value will Guido, it will be returned as it is.
    if re.match(r"Guido",value,re.IGNORECASE):
        return value
    else:
        for x in "aeiou":
            value= value.replace(x, '*')
        return value

main()

jQM在INPUT旁边创建一个滑块轨道DIV,因此CSS获取该DIV并使用 Adjacent Sibling selector

找到其中的句柄
  

<强> FIDDLE