Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery ui 此UI控件的jQuery版本(滑动切换开关)_Jquery Ui - Fatal编程技术网

Jquery ui 此UI控件的jQuery版本(滑动切换开关)

Jquery ui 此UI控件的jQuery版本(滑动切换开关),jquery-ui,Jquery Ui,我在只邀请测试版中使用webapp时遇到了这个控件,我喜欢这个UI交互。webapp是使用prototype/scriptaculous构建的,我们在构建web应用时通常使用jQuery。。我的问题是,有人见过与此UI元素等效的jQuery吗 我喜欢这种方法的两个优点,而不是典型的无线电台方法,是切换按钮的动画滑动效果,并且仍然能够在双击和调整光标大小时滑动 由于我没有该元素的工作示例,因此我附加了一个链接,以查看它的屏幕帽 我要找的是一个jQuery插件,它可以完成同样的事情。。或者jQuer

我在只邀请测试版中使用webapp时遇到了这个控件,我喜欢这个UI交互。webapp是使用prototype/scriptaculous构建的,我们在构建web应用时通常使用jQuery。。我的问题是,有人见过与此UI元素等效的jQuery吗

我喜欢这种方法的两个优点,而不是典型的无线电台方法,是切换按钮的动画滑动效果,并且仍然能够在双击和调整光标大小时滑动

由于我没有该元素的工作示例,因此我附加了一个链接,以查看它的屏幕帽

我要找的是一个jQuery插件,它可以完成同样的事情。。或者jQuery中类似的代码片段。 谢谢

看看这个:

这正是你想要的。或者至少很容易修改。单击页面下方的DEMO以查看它的实际操作

对于其他有趣的JQuery插件,请查看以下链接: 40个有用的JQuery插件:

20个很棒的JQuery按钮:


我经常提到他们:

好吧,让自己成为一名演员当然不容易。不容易,但很有趣。这是我第一次尝试创建插件,请原谅代码质量差。该代码使用但不是jQuery UI的扩展。具体来说,它使用可拖动组件作为句柄,以及一些UI CSS类

这当然是一项正在进行的工作。这决不是结束。在宣布这件事完成之前,我希望看到这些事情完成:

出于可访问性原因,用于移动手柄的键盘控制 实施WAI-RIA标准,同样也是为了方便访问 设置更多选项,甚至事件 将代码重构为更易于管理的代码。 前两个非常重要,这也是为什么现在还不应该使用此代码的原因。但是,欢迎您对代码进行破解并使用它。欢迎所有关于如何使这件事更好地工作的建议

现场演示:


还可以查看即将推出的图书馆。他们会有一个像那个一样的控件。10月下旬的某个时候,我们应该首先看到一些明显的输出。

jquery滑块使用3幅图像切换

<!DOCTYPE HTML>
<html>
    <head>
       <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
       </script>
       <link type="text/css" rel="stylesheet" href="style.css">
       <script>
            $(document).ready(function() {
               $('.bool-slider .inset .control').click(function() {
                    if ($(this).parent().parent().hasClass('true')) {
                    $(this).parent().parent().addClass('false').removeClass('true');

                     } 
                     else
                    {
                    $(this).parent().parent().addClass('true').removeClass('false');
                    }  
                });
            });
        </script>
    </head>
    <body>  
        <div class="bool-slider false">
            <div class="inset">
                <div class="control"></div>
            </div>
        </div> 
    </body>
</html>


css code


.bool-slider.true .inset
{ 
    width:79px;
    height: 31px;
    background: url(images/On.png)no-repeat;

}
.bool-slider.true .inset .control
{
    float: left;
}
.bool-slider.true .inset .control:after
{
    content: 'On';
    position: relative;
    right: -135%;
    top: 20%;
}

.bool-slider.false .inset
{
        width:79px;
        height: 31px;
        background: url(images/Off.png)no-repeat;
}
.bool-slider.false .inset .control
{
    float: right;
}
.bool-slider.false .inset .control:before
{
    content: 'Off';
    position: relative;
    left: -100%;
    top: 20%;
}
.bool-slider .inset .control
{

    width: 40%;
    height: 100%;
    background: url(images/Button.png)no-repeat;
}

.bool-slider .inset .control:hover
{
    cursor: pointer;
}

谢谢你的链接。。这是一个好看的插件,但它实际上只是一个使用动画的切换,它实际上不提供拖动功能。。因此,它与我们现在的情况非常相似。但是,谢谢你的链接!我已经去过smashingmag链接好几次了,总是读得很好,而speckyboy链接也很酷。。再次谢谢你,好的。我不知道拖拽性是你特别想要的。虽然我不得不从用户的角度说,我提供的简单的点击操作可能更容易。但我会继续四处看看,或者自己做一个!:太好了!使用JSFIDLE测试代码总是很有趣的:D感谢您花时间解决这个问题!我每天都在学习,真的很感谢你的帮助。。因为我的技能更多地存在于HTML5/CSS3/UX/UI领域。。我一直在努力学习如何扩展jQuery。我将进一步研究代码,如果您能够/有时间解决您列出的问题,。。我非常乐意尽我所能提供任何帮助。再次感谢!谢谢你,克里斯。。我一直在密切关注jQuery Mobile。。。急切地等待它的发布:谢谢!
<!DOCTYPE HTML>
<html>
    <head>
       <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
       </script>
       <link type="text/css" rel="stylesheet" href="style.css">
       <script>
            $(document).ready(function() {
               $('.bool-slider .inset .control').click(function() {
                    if ($(this).parent().parent().hasClass('true')) {
                    $(this).parent().parent().addClass('false').removeClass('true');

                     } 
                     else
                    {
                    $(this).parent().parent().addClass('true').removeClass('false');
                    }  
                });
            });
        </script>
    </head>
    <body>  
        <div class="bool-slider false">
            <div class="inset">
                <div class="control"></div>
            </div>
        </div> 
    </body>
</html>


css code


.bool-slider.true .inset
{ 
    width:79px;
    height: 31px;
    background: url(images/On.png)no-repeat;

}
.bool-slider.true .inset .control
{
    float: left;
}
.bool-slider.true .inset .control:after
{
    content: 'On';
    position: relative;
    right: -135%;
    top: 20%;
}

.bool-slider.false .inset
{
        width:79px;
        height: 31px;
        background: url(images/Off.png)no-repeat;
}
.bool-slider.false .inset .control
{
    float: right;
}
.bool-slider.false .inset .control:before
{
    content: 'Off';
    position: relative;
    left: -100%;
    top: 20%;
}
.bool-slider .inset .control
{

    width: 40%;
    height: 100%;
    background: url(images/Button.png)no-repeat;
}

.bool-slider .inset .control:hover
{
    cursor: pointer;
}