0
工程奇怪我建立這個表格的WordPress的 http://xn--5dbaaldanagj3al0n.org.il/jQuery UI的selectmenu與WordPress 3.5
3.4版本我植入jquery ui
文件,像這樣
add_action('init', 'frontporch_enqueue_scripts');
function frontporch_enqueue_scripts() {
if (!is_admin()) {
wp_enqueue_script('jquery');
wp_register_script('google-jquery-ui', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js', array('jquery'));
wp_register_script('ui-core', get_bloginfo('template_directory').'/ui/jquery.ui.core.js',array('jquery'), true);
wp_register_script('ui-position', get_bloginfo('template_directory').'/ui/jquery.ui.position.js',array('jquery'), true);
wp_register_script('ui-selectmenu', get_bloginfo('template_directory').'/ui/jquery.ui.selectmenu.js',array('jquery'), true);
wp_register_script('ui-widget', get_bloginfo('template_directory').'/ui/jquery.ui.widget.js',array('jquery'), true);
wp_register_style('jquery-core', get_bloginfo('template_directory').'/themes/base/jquery.ui.core.css', true);
wp_register_style('jquery-selectmenu', get_bloginfo('template_directory').'/themes/base/jquery.ui.selectmenu.css', true);
wp_register_style('jquery-theme', get_bloginfo('template_directory').'/themes/base/jquery.ui.theme.css', true);
wp_enqueue_style('jquery-core');
wp_enqueue_style('jquery-selectmenu');
wp_enqueue_style('jquery-theme');
wp_enqueue_script('google-jquery-ui');
wp_enqueue_script('ui-core');
wp_enqueue_script('ui-position');
wp_enqueue_script('ui-selectmenu');
wp_enqueue_script('ui-widget');
}
}
,把腳本在header.php
文件像這樣
<script>
jQuery(document).ready(function($) {
$("#formlocation select").selectmenu();
$("#formlocation input[type=text]").button();
});
</script>
現在當你進入the site,你會看到t他下拉列表看起來很奇怪,寬度假設與所有字段相同,並且選擇已損壞。 當我完成這個表格的開發時,一切都很順利。
其因爲3.5版本自帶jquery ui
文件?它是否3.5? 我試圖起飛的JS實現,但它並沒有工作
很想知道什麼預先有 感謝回事