)試圖讓WordPress庫在wordpress中運行,但我不太確定要放入.ready(函數)以便運行原始頁面到jQuery的功能在這裏:http://manos.malihu.gr/simple-jquery-fullscreen-image-gallery/2什麼把jQuery(文檔).ready(函數()
我假設我需要運行一些函數來運行整個javascript文件,但我不太確定那個函數可能是什麼。這是如此的新穎,但非常感謝您的幫助!
function malihu_gallery() {
if (!is_admin()) {
// Enqueue Malihu Gallery JavaScript
wp_register_script('malihu-jquery-image-gallery', get_template_directory_uri(). '/js/malihu-jquery-image-gallery.js', array('jquery'), 1.0, true);
wp_enqueue_script('malihu-jquery-image-gallery');
// Enqueue Malihu Gallery Stylesheet
wp_register_style('malihu-style', get_template_directory_uri() . '/CSS/malihu_gallery.css', 'all');
wp_enqueue_style('malihu-style');
function gallery_settings() { ?>
<script type="text/javascript">
jQuery(document).ready(function() {
// What do I put in here?
});
</script><?php
}
}
}
add_action('init', 'malihu_gallery');
似乎腳本中有一些$(window).load(function()嵌入其中,所以我不確定是否需要添加任何東西 – coopersita
您是使用完整的HTML/Javascript還是僅僅使用Javascript? – Ian
我正在投票結束,這就像是問,_「我要在'
'裏面放什麼'?」_或_「我在CSS文件中放什麼?」_ – Sparky