开发者

Help me to apply fadeIn on Dropdown menu

I am trying to apply fadeIn effect on Dropdown menu.When user clicks on dropdown the menu should be displayed in a very slow motion.For that i am using fadeIn()..

Below is HTML code and jQuery code.

I know my code is not correct, hope someone will help me.

 <select  tabind开发者_如何学运维ex="21" name="S8a3_201" id="S8a3_201"  class="dropdown">
 <option value="">Select answer</option>
 <option value="1">One</option>
 <option value="2">Two</option>
 <option value="3">Three</option>
 <option value="4">Four</option>
 <option value="5">Five</option>
 <option value="6">Six</option>
 <option value="995">Seven</option>
 </select>  

The code i have written is

$('select').click(function()
              {
                  $(this).fadeIn('slow', function() {
    // Animation complete
  });
              });


You don't have any control over the way the control itself works or displays using any combination of javascript or CSS. If you must have the animated fade on a dropdown you will have to reimplement a dropdown list using content within a containing <div> instead.

jQuery has several of these as plugins already.

http://plugins.jquery.com/plugin-tags/jquery-dropdown

jQuery UI also has a split button component you could use: http://jqueryui.com/demos/button/#splitbutton


Select boxes are operating system controls, you're not going to be able to control how the drop down they present comes into view. Even if you could, it wouldn't be standard across all operating systems.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜