简体   繁体   English

选择框jquery过渡不起作用

[英]select box jquery transition not working

I am trying to use this: http://abeautifulsite.net/blog/2011/01/jquery-selectbox-plugin/ 我想用这个: http//abeautifulsite.net/blog/2011/01/jquery-selectbox-plugin/

to add a transition by default to my select-box. 默认情况下将转换添加到我的选择框。

This is the bit of JavaScript: 这是一点点JavaScript:

$(document).ready( function() {

    $("SELECT").selectBox()
    $("SELECT").click( function() { 
        $("SELECT").selectBox('settings', { 
            'menuTransition': 'slide',
            'menuSpeed' : 'fast' 
        });
    });

});

I can't seem to make it slide by default. 我似乎无法默认滑动。 What am I doing wrong? 我究竟做错了什么? I was able to get it to work by including a separate button exactly like in the demo page. 我能够通过包含一个与演示页面完全相同的单独按钮来实现它。 But I want it to use the slide animation by default and can't see/figure out what is wrong? 但我希望它默认使用幻灯片动画,无法查看/弄清楚出了什么问题?

The selectBox plugin looked interesting so I tried it out and I believe your issue is that you are trying to dynamically set the transition type to slide but you want to create the selectBox with different settings than the default ones, try this: selectBox插件看起来很有趣,所以我试了一下,我相信你的问题是你试图动态设置转换类型为slide但是你想要创建与默认设置不同的设置的selectBox ,试试这个:

$(document).ready( function() {
    $("SELECT").selectBox({
        menuTransition : 'slide',
        menuSpeed      : 'fast'
    });
});

Here is a working example of this solution: http://jsfiddle.net/jasper/APzDJ/ 以下是此解决方案的一个工作示例: http//jsfiddle.net/jasper/APzDJ/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM