jqueryUI入门

问题描述

| 我只是想让最基本的东西走到这里,并被完全停止。我正在尝试遵循这些示例,但是由于某种原因,即使是一个基本的示例都无法正常工作。在这里,我只是想让JQueryUI选择菜单起作用。这个演示页面对我来说很好用,但是当我尝试使用自己的页面时,它什么也不做(也没有错误)。
<!DOCTYPE html> 
<html> 
    <head> 
    <Meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" /> 
    <title>Demo Page for jQuery UI selectmenu</title>

    <link type=\"text/css\" href=\"http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/start/jquery-ui.css\" rel=\"Stylesheet\" /> 
    <script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js\"></script>
    <script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js\"></script>

    <script type=\"text/javascript\"> 
        $(function(){

            $(\'#testselect\').selectmenu({style:\'dropdown\'});
        });
    </script> 
</head> 
<body> 
    <select id=\"testselect\"> 
        <option value=\"test1\">Op 1</option> 
        <option value=\"test2\">Op 2</option> 
        <option value=\"test3\">Op 3</option> 
    </select> 
</body> 
</html>
看来我在selectmenu行上遇到了“对象不支持方法错误,但是我不知道为什么这将不可用,因为基于演示,鉴于给定的脚本链接在那里,指向有效的位置。     

解决方法

不是
$(\'#testselect\').selectmenu();
,而是
$(\'#testselect\').selectable();
,请参阅文档(如果您正在谈论此内容)。 更新: 如您链接的文档页面所述,SelectMenu小部件仍在开发中。它尚不存在,因此您无法使用它(或者您可以自行承担将其合并到当前jQueryUI中的风险)。