How to use JQuery in Fusion
-
I am using Word Presss 2.8.1 and a child theme based in Fusion 3.0.4.
I want to use this jquery accordeon effect on my sidebar. (https://jqueryfordesigners.com/jquery-look-tim-van-damme/)
But I can’t make it work on Word Press.I pasted the code on sidebar.php and the corresponsing css in style.css
The header.php already includes those lines of code:
// <?php if ( is_singular() ) wp_enqueue_script( ‘comment-reply’ ); ?>
// <?php if(get_option(‘fusion_jquery’)<>’no’) { ?>
// <?php wp_enqueue_script(‘jquery’); ?>
// <?php wp_enqueue_script(‘fusion’,get_bloginfo(‘template_url’).’/js/fusion.js’); ?>
// <?php } ?>// <?php wp_head(); ?>
So, I guess I don’t need to call the jquery script
I tried pasting the following code in different places: inside the // <head></head> in the footer.php, I tried pasting it in the functions.php, and to include it in fusion.js, but nothing seem to work
// <script type=”text/javascript”>
// jQuery(document).ready(function($){
// $(‘.navigation’).each(function () {
// var $links = $(this).find(‘a’),
// panelIds = $links.map(function() { return this.hash; }).get().join(“,”),// $panels = $(panelIds),
// $panelwrapper = $panels.filter(‘:first’).parent(),
// delay = 500,
// heightOffset = 40; // we could add margin-top + margin-bottom + padding-top + padding-bottom of $panelwrapper// $panels.hide();
// $links.click(function () {
// var link = this,
// $link = $(this);// ignore if already visible
// if ($link.is(‘.selected’)) {
// return false;
// }// $links.removeClass(‘selected’);
// $link.addClass(‘selected’);
//
// document.title = ‘jQuery look: Tim Van Damme – ‘ + $link.text();// if ($.support.opacity) {
// $panels.stop().animate({opacity: 0 }, delay);
}// $panelwrapper.stop().animate({
// height: 0
// }, delay, function () {
// var height = $panels.hide().filter(link.hash).css(‘opacity’, 1).show().height() + // heightOffset;// $panelwrapper.animate({
// height: height
// }, delay);
// });
// });// $links.filter(window.location.hash ? ‘[hash=’ + window.location.hash + ‘]’ : ‘:first’).click();
// });
// });// </script>
I tried to make an external link to google
// <script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js” type=”text/javascript”></script>but nothing worked.
I have so many things to put in the sidebar. It would be wonderful if I could make it work.
I’ll appreciate any help.
- The topic ‘How to use JQuery in Fusion’ is closed to new replies.