WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Shortcodes
Make accordion to open during hover event (onmouseover) (1 post)

  1. nanoo_k
    Member
    Posted 1 year ago #

    Here's one way to make the accordion shortcode generate an accordion that opens during a hover event instead of a click event.

    Go to wp-content > plugins > synved-shortcodes > synved-shortcode > script > base.js, line 36. Add this line: params.event = "mouseover"; The whole block looks like this:

    jQuery('.synved-section-list', context).removeClass('synved-section-list-nojs').each(function() {
    		var jthis = jQuery(this);
    		var params = { autoHeight: false, navigation : true };
    
    		if (jthis.hasClass('synved-sections-collapse'))
    		{
    			params.collapsible = true;
    		}
    
    		if (jthis.hasClass('synved-sections-collapse-always'))
    		{
    			params.active = false;
    		}
    
    		params.event = "mouseover"; // Line to add
    
    		jthis.accordion(params);
    	});

    Add that line and ALL your accordions will open during a hover event. Check out the plugin's API for other options (courtesy of the jQuery UI Accordion team: http://api.jqueryui.com/accordion/#option-event )

    Cheers.

    http://wordpress.org/extend/plugins/synved-shortcodes/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 1 year ago by nanoo_k
  • This topic is not a support question
  • WordPress version: 3.5.1