【发布时间】:2012-12-20 06:22:31
【问题描述】:
我在 wordpress 3.4 版上构建此表单 http://xn--5dbaaldanagj3al0n.org.il/
我像这样植入了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 时,您会看到下拉列表看起来很奇怪,宽度假设与所有字段相同,并且选择已损坏。 当我完成这个表单的开发时,一切都很顺利。
是因为 3.5 版本带有自己的 jquery ui 文件吗?是3.5吗??
我试图取消 JS 实现,但没有成功
很想知道那里发生了什么 提前致谢
【问题讨论】:
标签: wordpress jquery-ui contact-form-7 jquery-ui-selectmenu