0

谁能帮我一把?这是一个慈善活动,编码显然不是我的日常工作。该网站是 www.gingertown.org/wp

我不明白把这条线放在哪里:

$(function() {
$('.scroll-pane').jScrollPane();
});

我也有一种感觉,我没有正确调用 js。从深入研究 wordpress

我修改了我的文件,如下所示:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>

<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php wp_title('&#124;', true, 'right'); ?> <?php bloginfo('name'); ?></title>
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

<link rel="stylesheet" href="<?php bloginfo( 'stylesheet_url' ); ?>" type="text/css" media="screen" />
</code></pre>

    <?php wp_enqueue_script("jquery"); ?>
    <?php wp_enqueue_script( 'sfhover', get_template_directory_uri() . '/js/sfhover.js' ); ?>
    <?php wp_head(); ?>

    <!-- the mousewheel plugin - optional to provide mousewheel support -->
    <script type="text/javascript" 
 src="script/jquery.mousewheel.js"></script>

    <!-- the jScrollPane script -->
    <script type="text/javascript" 
 src="script/jquery.jscrollpane.min.js"></script>



    </head>
4

1 回答 1

1

你应该把它放在 jscrollpane 插件之后,这里:

<script type="text/javascript" src="script/jquery.jscrollpane.min.js"></script>
<script type="text/javascript">
  jQuery(function($) {         //since your site is calling jQuery.noConflict()
    $('.scroll-pane').jScrollPane();
  });
</script>
</head>
于 2010-09-13T22:03:45.203 回答