我已经看过了抄本中的所有文档,但我做错了,因为它不起作用!
我想实现这个jQuery插件(https://github.com/davidcrawford/typist-jquery) 在我的欢迎页面中(www.english.intermediavs.com).
我在函数中添加了此代码。php:
function my_typist() {
if (!is_admin()) {
wp_enqueue_script(\'jquery\');
wp_enqueue_script(\'jquery.typist\', get_bloginfo(\'template_url\') . \'/wp-includes/js/jquery.typist.js\', array(\'jquery\'), \'1.0\', true);
}
}
add_action(\'init\', \'my_typist\');
我还使用html原始插件在“欢迎页面”中介绍了这段代码:<!--raw-->
<script type="text/javascript" src="<?php bloginfo(\'template_url\'); ?>/wp-includes/js/jquery.typist.js">
jQuery(document).ready(function($) {
$(\'#terminal\').typist({
height: 300
});
$(\'#terminal\').typist(\'prompt\')
.wait(1500)
.typist(\'type\', \'greet\')
.typist(\'echo\', \'Hello, world!\')
});
</script>
<!--/raw-->
PS:我正在使用插件使用谷歌库。链接:http://codex.wordpress.org/Using_Javascript
http://codex.wordpress.org/Function_Reference/wp_enqueue_script