Results 1 to 2 of 2

Thread: Pausing Featured Content Slider onMouseOver - - Does anyone have a clue?

  1. #1
    Join Date
    Oct 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Pausing Featured Content Slider onMouseOver - - Does anyone have a clue?

    1) Script Title:
    Featured Content Slider

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...tentslider.htm

    3) Describe problem:
    I was wondering how to pause the slideshow when the mouse is over the actual content, without clicking on the textual link. I Already costumized the script a bit, see http://www.teenagechannel.nl/ for an example.

    I posted this before, but nobody replied. Does anyone have a clue how i can fix this, its really important.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Sure. Attached is the default contentslider.js file, modified to include "pause" onmouseover feature. Since you mentioned you had customized the file already yourself, the changes you need to make based on the default file are:

    1) Replace the code:

    Code:
    	if (typeof autorun=="number" && autorun>0) //if autorun parameter (int_miliseconds) is defined, fire auto run sequence
    window[sliderid+"timer"]=setTimeout(function(){ContentSlider.autoturnpage(sliderid, autorun)}, autorun)
    with:

    Code:
    	if (typeof autorun=="number" && autorun>0){ //if autorun parameter (int_miliseconds) is defined, fire auto run sequence
    		window[sliderid+"timer"]=setTimeout(function(){ContentSlider.autoturnpage(sliderid, autorun)}, autorun)
    		document.getElementById(sliderid).mouseisover=0
    		document.getElementById(sliderid).onmouseover=function(){this.mouseisover=1}
    		document.getElementById(sliderid).onmouseout=function(){this.mouseisover=0}
    	}
    And replace function ContentSlider.autoturnpage=function(sliderid, autorunperiod) with the below instead:

    Code:
    ContentSlider.autoturnpage=function(sliderid, autorunperiod){
    	if (document.getElementById(sliderid).mouseisover==0){
    	var paginatelinks=document.getElementById("paginate-"+sliderid).getElementsByTagName("a") //Get pagination links
    	var nextpagenumber=parseInt(paginatelinks[paginatelinks.length-1].getAttribute("rel")) //Get page number of next DIV to show
    	ContentSlider.turnpage(sliderid, nextpagenumber) //Show that DIV
    	}
    	window[sliderid+"timer"]=setTimeout(function(){ContentSlider.autoturnpage(sliderid, autorunperiod)}, autorunperiod)
    }

Bookmarks

Posting Permissions

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