灯丝组滑块不同的手柄
我目前正在开发一个需要两个滑块的项目。目前我正在使用 Filamantgroup 滑块 (http://d.pr/mHp3)。
但我有一个小问题..我需要我的两个手柄彼此不同。他们看起来不可能一样。
当我创建自己的滑块时,我只是向手柄添加了一个类,仅此而已。一切都很顺利。
$('#slidertest').each(function() {
$('.ui-slider-handle:first', this).addClass('firstslider-handle-left')
$('.ui-slider-handle:last', this).addClass('firstslider-handle-right')
});
但是现在,有了我正在使用的 Filamentgroup 滑块。我不知道该怎么做。我已经寻找解决方案一个多月了,但我无法弄清楚。我给滑块的创建者发了邮件,但他们认为我的解决方案是正确的。
我认为问题是我如何调用滑块。它不是一个 DIV。我试图给每一个东西一个 ID,并在每个可能的 ID 上尝试上面的代码。但没有任何效果。
<div id="licht">
<form action="#">
<fieldset id="test">
<select name="aan" id="aan">
<option value="6am">6u00</option>
<option value="6.5am">6u30</option>
<option value="7am">7u00</option>
<option value="7.5am">7u30</option>
<option value="8am">8u00</option>
<option value="8.5am">8u30</option>
<option value="9am">9u00</option>
<option value="9.5am">9u30</option>
<option value="10am" selected="selected">10u00</option>
<option value="10.5am">10u30</option>
<option value="11am">11u00</option>
<option value="11.5am">11u30</option>
<option value="12am">12u00</option>
<option value="12.5pm">12u30</option>
<option value="1pm">1u00</option>
<option value="1.5pm">1u30</option>
<option value="2pm">2u00</option>
<option value="2.5pm">2u30</option>
<option value="3pm">3u00</option>
<option value="3.5pm">3u30</option>
<option value="4pm">4u00</option>
<option value="4.5pm">4u30</option>
<option value="5pm">5u00</option>
<option value="5.5pm">5u30</option>
<option value="6pm">6u00</option>
<option value="6.5pm">6u30</option>
<option value="7pm">7u00</option>
<option value="7.5pm">7u30</option>
<option value="8pm">8u00</option>
<option value="8.5pm">8u30</option>
<option value="9pm">9u00</option>
<option value="9.5pm">9u30</option>
<option value="10pm">10u00</option>
<option value="10.5pm">10u30</option>
<option value="11pm">11u00</option>
<option value="11.5pm">11u30</option>
<option value="12pm">12u00</option>
<option value="1am">1u00</option>
<option value="1.5am">1u30</option>
<option value="2am">2u00</option>
<option value="2.5am">2u30</option>
<option value="3am">3u00</option>
<option value="3.5am">3u30</option>
<option value="4am">4u00</option>
<option value="4.5am">4u30</option>
<option value="5am">5u00</option>
<option value="5.5am">5u30</option>
<option value="6am">6u00</option>
</select>
<select name="uit" id="uit">
<option value="6am">6u00</option>
<option value="6.5am">6u30</option>
<option value="7am">7u00</option>
<option value="7.5am">7u30</option>
<option value="8am">8u00</option>
<option value="8.5am">8u30</option>
<option value="9am">9u00</option>
<option value="9.5am">9u30</option>
<option value="10am">10u00</option>
<option value="10.5am">10u30</option>
<option value="11am">11u00</option>
<option value="11.5am">11u30</option>
<option value="12am">12u00</option>
<option value="12.5pm">12u30</option>
<option value="1pm">1u00</option>
<option value="1.5pm">1u30</option>
<option value="2pm">2u00</option>
<option value="2.5pm">2u30</option>
<option value="3pm">3u00</option>
<option value="3.5pm">3u30</option>
<option value="4pm">4u00</option>
<option value="4.5pm">4u30</option>
<option value="5pm">5u00</option>
<option value="5.5pm">5u30</option>
<option value="6pm">6u00</option>
<option value="6.5pm">6u30</option>
<option value="7pm">7u00</option>
<option value="7.5pm">7u30</option>
<option value="8pm">8u00</option>
<option value="8.5pm">8u30</option>
<option value="9pm" selected="selected">9u00</option>
<option value="9.5pm">9u30</option>
<option value="10pm">10u00</option>
<option value="10.5pm">10u30</option>
<option value="11pm">11u00</option>
<option value="11.5pm">11u30</option>
<option value="12pm">12u00</option>
<option value="1am">1u00</option>
<option value="1.5am">1u30</option>
<option value="2am">2u00</option>
<option value="2.5am">2u30</option>
<option value="3am">3u00</option>
<option value="3.5am">3u30</option>
<option value="4am">4u00</option>
<option value="4.5am">4u30</option>
<option value="5am">5u00</option>
<option value="5.5am">5u30</option>
<option value="6am">6u00</option>
</select>
</fieldset>
</form>
</div>
我真的希望你们能帮助我。 提前致谢!
I'm currently working on a project for which I need two sliders.. Currently I'm using the Filamantgroup slider (http://d.pr/mHp3).
But I have a little problem.. I need my two handles to be different from each other. They can't look the same.
When I created my own sliders, I just added a class to the handles and that was it. Everything worked out great..
$('#slidertest').each(function() {
$('.ui-slider-handle:first', this).addClass('firstslider-handle-left')
$('.ui-slider-handle:last', this).addClass('firstslider-handle-right')
});
But now, with the Filamentgroup slider I'm using. I can't figure out how to do that. I've been looking for solutions for over a month now and I can't figure it out. I mailed the creators of the sliders, but they thought my solution was the right one.
I think the problem is how I can call on the slider. It isn't a DIV. I tried to give every single thing an ID and tried it the code above on every ID possible. But nothing worked.
<div id="licht">
<form action="#">
<fieldset id="test">
<select name="aan" id="aan">
<option value="6am">6u00</option>
<option value="6.5am">6u30</option>
<option value="7am">7u00</option>
<option value="7.5am">7u30</option>
<option value="8am">8u00</option>
<option value="8.5am">8u30</option>
<option value="9am">9u00</option>
<option value="9.5am">9u30</option>
<option value="10am" selected="selected">10u00</option>
<option value="10.5am">10u30</option>
<option value="11am">11u00</option>
<option value="11.5am">11u30</option>
<option value="12am">12u00</option>
<option value="12.5pm">12u30</option>
<option value="1pm">1u00</option>
<option value="1.5pm">1u30</option>
<option value="2pm">2u00</option>
<option value="2.5pm">2u30</option>
<option value="3pm">3u00</option>
<option value="3.5pm">3u30</option>
<option value="4pm">4u00</option>
<option value="4.5pm">4u30</option>
<option value="5pm">5u00</option>
<option value="5.5pm">5u30</option>
<option value="6pm">6u00</option>
<option value="6.5pm">6u30</option>
<option value="7pm">7u00</option>
<option value="7.5pm">7u30</option>
<option value="8pm">8u00</option>
<option value="8.5pm">8u30</option>
<option value="9pm">9u00</option>
<option value="9.5pm">9u30</option>
<option value="10pm">10u00</option>
<option value="10.5pm">10u30</option>
<option value="11pm">11u00</option>
<option value="11.5pm">11u30</option>
<option value="12pm">12u00</option>
<option value="1am">1u00</option>
<option value="1.5am">1u30</option>
<option value="2am">2u00</option>
<option value="2.5am">2u30</option>
<option value="3am">3u00</option>
<option value="3.5am">3u30</option>
<option value="4am">4u00</option>
<option value="4.5am">4u30</option>
<option value="5am">5u00</option>
<option value="5.5am">5u30</option>
<option value="6am">6u00</option>
</select>
<select name="uit" id="uit">
<option value="6am">6u00</option>
<option value="6.5am">6u30</option>
<option value="7am">7u00</option>
<option value="7.5am">7u30</option>
<option value="8am">8u00</option>
<option value="8.5am">8u30</option>
<option value="9am">9u00</option>
<option value="9.5am">9u30</option>
<option value="10am">10u00</option>
<option value="10.5am">10u30</option>
<option value="11am">11u00</option>
<option value="11.5am">11u30</option>
<option value="12am">12u00</option>
<option value="12.5pm">12u30</option>
<option value="1pm">1u00</option>
<option value="1.5pm">1u30</option>
<option value="2pm">2u00</option>
<option value="2.5pm">2u30</option>
<option value="3pm">3u00</option>
<option value="3.5pm">3u30</option>
<option value="4pm">4u00</option>
<option value="4.5pm">4u30</option>
<option value="5pm">5u00</option>
<option value="5.5pm">5u30</option>
<option value="6pm">6u00</option>
<option value="6.5pm">6u30</option>
<option value="7pm">7u00</option>
<option value="7.5pm">7u30</option>
<option value="8pm">8u00</option>
<option value="8.5pm">8u30</option>
<option value="9pm" selected="selected">9u00</option>
<option value="9.5pm">9u30</option>
<option value="10pm">10u00</option>
<option value="10.5pm">10u30</option>
<option value="11pm">11u00</option>
<option value="11.5pm">11u30</option>
<option value="12pm">12u00</option>
<option value="1am">1u00</option>
<option value="1.5am">1u30</option>
<option value="2am">2u00</option>
<option value="2.5am">2u30</option>
<option value="3am">3u00</option>
<option value="3.5am">3u30</option>
<option value="4am">4u00</option>
<option value="4.5am">4u30</option>
<option value="5am">5u00</option>
<option value="5.5am">5u30</option>
<option value="6am">6u00</option>
</select>
</fieldset>
</form>
</div>
I really hope you guys can help me.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我将 Filament Group 的演示页面粘贴到 JSBin 中: http://jsbin.com/acafo4
我使用了这个jQuery 添加 left &正确的类到手柄:
然后如下所示设置它们的样式。 .ui-slider 选择器很重要,因为它使这种样式比他们使用的样式更具选择性,从而使您不必放置!到处都很重要。
希望这有帮助!
I took the Filament Group's demo page and pasted into JSBin here: http://jsbin.com/acafo4
I used this jQuery to add left & right classes to the handles:
Then styled them as shown below. The .ui-slider selector is important because it makes this style more selective than the ones they've used, saving you from having to put ! important everywhere.
Hope this helps!
看起来这些句柄已经有一个 ID,试试这个:
确保这个 css 包含在默认样式之后,否则你可能需要在每行后面添加一个 !important 标志
It looks like those handles already have an ID, try this:
Make sure this css is included after the default styling, or else you might need to add an !important flag after each line