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 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need jcarousel video to stop on mouseover

    Total novice at jquery. have three videos to display on my website. all working fine, except when you hover over the tab for another video, the previous video keeps on playing, and if you click play on the other video, then to two play simultanously. I want the current video to stop when the site visitor hovers over another tab. Here's what I've got at the moment:

    <script type="text/javascript" src="/js/jquery.jcarousel.min.js"></script>
    <script type="text/javascript">
    /**
    * We use the initCallback callback
    * to assign functionality to the controls
    */
    function mycarousel_initCallback(carousel) {
    jQuery('.jcarousel-control a').bind('mouseover', function() {
    carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
    return false;
    });

    jQuery('.jcarousel-scroll select').bind('click', function() {
    carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
    return false;
    });

    jQuery('#mycarousel-next').bind('click', function() {
    carousel.next();
    return false;
    });

    jQuery('#mycarousel-prev').bind('click', function() {
    carousel.prev();
    return false;
    });
    };

    // Ride the carousel...
    jQuery(document).ready(function() {
    jQuery("#mycarousel").jcarousel({
    scroll: 1,
    initCallback: mycarousel_initCallback,
    // This tells jCarousel NOT to autobuild prev/next buttons
    buttonNextHTML: null,
    buttonPrevHTML: null
    });
    });

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,033
    Thanks
    203
    Thanked 2,539 Times in 2,517 Posts
    Are you anything to do with the

    Kilmeny Group Medical Practice
    Kilmeny Surgery
    50 Ashbourne Road
    Ingrow
    Keighley
    BD21 1LA



    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

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

    Smile

    Yorkshire (North) yes, but medical practice, no. Expat Canadian.


  •  

    Tags for this Thread

    Posting Permissions

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