【问题标题】:How is the jQuery slider implemented?jQuery滑块是如何实现的?
【发布时间】:2009-05-27 16:36:04
【问题描述】:

有人知道 jQuery 滑块是如何实现的吗?它是使用 JavaScript 画布库来绘制两条引导线还是其他什么?

谢谢!

【问题讨论】:

    标签: jquery jquery-ui


    【解决方案1】:

    jQuery 滑块使用 HTML 元素来构建滑块。它不使用画布库。

    这是滑块的构建方式:

    <div id="slider" class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all">
        <div class="ui-slider-range ui-widget-header" style="left: 17%; width: 50%;"/>
        <a class="ui-slider-handle ui-state-default ui-corner-all" href="#" style="left: 17%;"/>
        <a class="ui-slider-handle ui-state-default ui-corner-all" href="#" style="left: 67%;"/>
    </div>
    

    类:ui-widget ui-widget-content ui-corner-all ui-state-default都来自jQuery user interface CSS framework

    简而言之,这个插件混合使用了 HTML 元素、CSS 样式和 jQuery 事件来模拟滑块控件

    【讨论】:

      【解决方案2】:

      它是开源的,你可以看到源代码here。它不使用画布,只使用 html 元素。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-02-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多