Home Forums Pure Theme Discussion & Support How can I make the slider stop on mouse rollover

This topic is: not a support question

This topic contains 12 replies, has 3 voices, and was last updated by  themeweaver 5 years ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #2117

    Larry McMahon
    Participant

    Hi,

    Any suggestions on how to make the slider stop on a mouse over and restart on a mouse roll off?

    Larry

    #2118

    themeweaver
    Keymaster
    Post count: 730

    Not supported by theme and not sure if the jquery slider being used would support that out of the box either.

    But if you are a coder anything is possible. You’ll can review the slider component docs here:
    http://flex.madebymufffin.com/

    #2127

    Roger Leitch
    Participant
    Post count: 56

    In the theme settings, it is possible to modify the slide change durations.
    Where in the theme do those values get passed to the slider script?

    Reason for asking is that looking at the script, the paramenter “slideshowSpeed” is used by the script to set the speed.
    By extending the code so it also passes the parameter “pauseOnHover = true” to the script, then it should do what Larry is asking.

    #2128

    themeweaver
    Keymaster
    Post count: 730

    OK, that is quite easy to do. Hadn’t noticed it was just an option of the slider plugin.

    1. You could hack base\lib\flexi-slider.php, editing the livingos_flexi_slider_init() function.

    2. Better would be to remove the action that flexi-slider.php adds using wp’s remove_action() and role your own. That way you are not editing core theme code, so when you update the theme you don’t lose everything.

    Either way you can add the parameter to the javascript that this function adds to the footer.

    #2129

    Roger Leitch
    Participant
    Post count: 56

    Tried the crude hack to the core theme file on my test site and it works ok.

    …. [‘slider-time’]; ?>, pauseOnHover: true,
    controlsContainer: “.flexslider-container”

    Looks like it would not be too hard for you to add this as a theme option on a future update?

    pauseOnHover: false, //Boolean: Pause the slideshow when hovering over slider, then resume when no longer…

    Another option to add could be:
    slideDirection: “horizontal”, //String: Select the sliding direction, “horizontal” or “vertical”

    #2140

    Larry McMahon
    Participant

    Hi,

    I made that change to the base flexi-slider.php and it worked just fine. Thanks.

    However, I moved the change the /base/lib/flexi-slider.php in my child theme and it does not work.

    Any ideas?

    Larry

    #2143

    themeweaver
    Keymaster
    Post count: 730

    You must keep base intact. WordPress will pick up template files you move, but this file is part of our theme framework.

    If you used the remove_action method above, you shouldn’t need to change any code in base.

    All you have to do is copy the code for livingos_flexi_slider_init() into your child theme and edit that.

    #2147

    themeweaver
    Keymaster
    Post count: 730

    Try this in your child’s fucntions.php:

    //modify felxi slider features - first remove action then addd a&#160;&#160;new one<br />
    function my_felxi_slider_change(){<br />
    	remove_action( 'wp_footer', 'livingos_flexi_slider_init' );	<br />
    	add_action( 'wp_footer', 'my_flexi_slider_init' );<br />
    	}<br />
    add_action( 'init', 'my_felxi_slider_change' );<br />
    <br />
    function my_flexi_slider_init() {<br />
    	$options = get_option( 'livingos_theme_options' ); <br />
    	<br />
    	 ?&gt;<br />
    	&#160;&#160; &lt;script type="text/javascript"&gt; <br />
    	&#160;&#160; jQuery(document).ready(function()&#160;&#160;{<br />
    			jQuery('.flexslider').flexslider({<br />
    				animation: "&lt;?php echo $options['slider-effect']; ?&gt;",<br />
    				slideshowSpeed: &lt;?php echo $options['slider-time']; ?&gt;,<br />
    				controlsContainer: ".flexslider-container",<br />
    				pauseOnHover: true<br />
    			});<br />
    		});		<br />
    	&#160;&#160; &lt;/script&gt;<br />
    	&#160;&#160;<br />
    	&#160;&#160;&lt;?php<br />
    }
    

    #2152

    themeweaver
    Keymaster
    Post count: 730

    Actually now gone one step further:

    This extra feature is included in the example child theme for Pure available in the downloads section of Your Loom.

    #2161

    Larry McMahon
    Participant

    Hi,

    Thanks, I have the rolllover pause working.

    “You must keep base intact. WordPress will pick up template files you move, but this file is part of our theme framework.”

    I’m not an expert, but I thought the purpose of having a child theme was to permit such theme changes.

    Larry

    #2163

    themeweaver
    Keymaster
    Post count: 730

    WordPress automatically looks for the template files in your child theme folder. But they must be “template” files. The code in the framework (base folder) is functionality that comes with our themes and are not WP “template” files.

    Standard template files are things like single.php, header.php etc – most of the files in the theme root and some of the buddypress folders. The rest is not treated in this way.

    This is a WordPress feature and it does not look for other files.

    Anyway the framework (the code in base folder) was written in a way that allows you to work with it in a child theme without changing anything in that folder, as shown in the example child theme we have just made available for download.

    #2173

    Larry McMahon
    Participant

    Hi,

    So non-CSS theme changes would be made in functions.php?

    Larry

    #2174

    themeweaver
    Keymaster
    Post count: 730

    Yes in the child functions.php and css changes in the child style.css or in theme options.

    Of course if your are producing lots of extra code, then you are also free to structure your code in the theme into additional php files just as in any code project.

    Though no theme covers every eventuality – it wouldn’t be a theme then, it would be another WordPress!

    But if there is something specific you are trying to go, post it on the forums and someone will try and help.

Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.