jquery与自动完成结合使用

时间:2012-05-04 15:42:34

标签: jquery jquery-autocomplete

我正在使用jquery的apprise插件和自动完成功能。它正常工作,但显示的下拉列表未正确显示。我认为这是因为css中的z-index属性。但是,我相应地改变了它,但它没有用。有没有人对如何制作它有任何想法,以便下拉列表出现在apprise框内?

谢谢,

兰斯

 $(".link").click(function(){
        apprise("<h1 class='notorious'>Link to what?</h1><div class='team_box' style='background-color:#ffffff;height:165px;'><div style='border-right:solid 1px #e4e4e4;color:#090127;width:200px;float:left;'><input type='radio' id='user' name='user'/> User <br /><input type='radio' id='current_team' name='current_team'/> Current Season Team <br /><input type='radio' id='past_team' name='past_team'/> Past Season Team <br /><input type='radio' id='season' name='season'/> Season <br /><input type='radio' id='current_player' name='current_player'/> Current Season Player <br /><input type='radio' id='past_player' name='past_player'/> Past Season Player <br /><input type='radio' id='all_star' name='all_star'/> All Star Game <br /><input type='radio' id='series' name='series'/> Series <br /></div><div id='belinda' style='float:left;margin-left:15px;'><input type='text' id='shadow' class='bar' style='display:none;'/></div></div>");

        jQuery('input[name=current_team]:radio').click(function(){
            $('#shadow').fadeIn('slow');

            var data = ["Baltimore Orioles", "New York Yankees", "Toronto Blue Jays", "Tampa Bay Rays", "Boston Red Sox", "Kansas City Royals", "Chicago White Sox", "Cleveland Indians", "Detroit Tigers", "Minnesota Twins", "Texas Rangers", "Seattle Mariners", "Oakland Athletics", "Los Angeles Angels", "Philadelphia Phillies", "Atlanta Braves", "New York Mets", "Washington Nationals", "Miami Marlins", "Cincinatti Reds", "Pittsburgh Pirates", "Chicago Cubs", "St. Louis Cardinals", "Houston Astros", "Milwaukee Brewers", "Los Angeles Dodgers", "Colorado Rockies", "Arizona Diamondbacks", "San Francisco Giants", "San Diego Padres"];

            $("#shadow").autocomplete({ 
                source: data
            });
        });
    });

1 个答案:

答案 0 :(得分:0)

z-index是问题所在。值10000000000应该有效。