Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    pause slider on mouseenter

    Hi, I'm new to JS and I hope you can help.

    I have product sliders on my homepage. They are within an unordered list withthe class 'products'. When you mouseover two images appear with 'more info' and 'add to cart' links, however the slider doesn't pause when in mouseover state, so before you can decide which button to click, it slides away, very frustrating.

    In the jquery.custom.js file I have the following code

    Code:
    b.slideToggle()});a("ul.products li.product.classic a.thumb").on({mouseenter:function(){a(this).find("img").animate({opacity:0.75},500)},mouseleave:function(){a(this).find("img").stop().animate({opacity:1},500)}});a(document).on("hover","ul.products li.product.grid:not(.classic), ul.products li.product.list .thumbnail-wrapper",function(b){if("mouseenter"==b.type){b=a(this);b.hasClass("thumbnail-wrapper")&&(b=b.parents("li"));var c=b.find(".thumbnail-wrapper").width(),e=b.find(".thumbnail-wrapper").height(),
    I need to edit this code to pause on mouseenter and resume on mouseleave

    I have the following code to stop/start the slider on mouseover/mouseleave but I don't know enough about JS in order to add this to the above function.

    Code:
    jQuery(document).ready(function($) {
        $('.products').on('mouseenter', function() {
            $('.products').data('products').resumePlayback();
        });
        $('.products').on('mouseleave', function() {
            $('.products').data('products').pausePlayback();
        });
    });
    Thank you in advance
    Martin

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,354
    Thanks
    23
    Thanked 618 Times in 617 Posts
    Put up a link to your site please
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • #3
    New to the CF scene
    Join Date
    Jun 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •