WordPress.org

Ready to get started?Download WordPress

Forums

How to use trigger in functions.js to show pages (1 post)

  1. M
    Member
    Posted 4 years ago #

    I'm using gridfocus theme and it uses a very simple functions script. It shows a nice dropdown where the function toggles categories. See here (http://www.mediasinfo.ro - click on "Stiri" in the footer navigation).

    I have been trying to extend the functionality and add a second button in the menu, to show pages. I tried copying (& changing the ID of course) of the trigger function used for categories. Unfortunately, the function is not correct. I changed the name to triggerPageID and obviously there's no such thing.. It looks wierd though, as the function keeps calling the Categories IDs. I've copy-pasted the function.js content below:

    jQuery(document).ready(function() {
    	// easy toggle for categories
    	jQuery('#triggerCatID').click(function() {
    		jQuery(this).toggleClass('focus');
    		jQuery('#headerStrip').animate({ height: 'toggle', opacity: '100'}, 100);
    		return false;
    	});
    	jQuery('#triggerCatID2').click(function() {
    		jQuery(this).toggleClass('focus');
    		jQuery('#footerStrip').animate({ height: 'toggle', opacity: '100'}, 100);
    		return false;
    	});
    	jQuery('#triggerPageID').click(function() {
    		jQuery(this).toggleClass('focus');
    		jQuery('#footerStrip').animate({ height: 'toggle', opacity: '100'}, 100);
    		return false;
    	});
    });

    Any idea how can this be fixed? Do you have any reading recommendations?

    Many thanks in advance.

Topic Closed

This topic has been closed to new replies.

About this Topic