Results 1 to 3 of 3

Thread: How to Stop Slider from rotating on some other action

  1. #1
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post How to Stop Slider from rotating on some other action

    1) Script Title: Feature Content Slider

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

    3) Describe problem: I have feature content slider placed as given and works fine. I want to stop the slider from rotating onclick of other div. In other words, i have placed a tabslideout like this (http://www.building58.com/examples/tabSlideOut.html) in the same page where i have the feature slider.

    So when i click to open this tabslider, i want to stop the content slider to stop rotating and resume when i close this tabslideout. Please let me know if it is possible and suggesitons to do it.

    Thanks for your help.

    Thanks,
    Sudeer.
    Last edited by ddadmin; 09-08-2011 at 01:19 AM.

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

    Default

    Sure, try the below modified contentslider.js file, which adds a new public method:

    Code:
    featuredcontentslider.playpause('sliderid', 'play|pause')
    The first parameter of the method should be the ID of the slider (same ID used in the initialization code of the slider in question), and the second, a string of either "play" or "pause". This method when called either pauses or plays the slider in question. For example, given a slider with the following initialization code:

    Code:
    <script type="text/javascript">
    
    featuredcontentslider.init({
    	id: "slider1",  //id of main slider DIV
    	contentsource: ["inline", ""],  //Valid values: ["inline", ""] or ["ajax", "path_to_file"]
    	toc: "#increment",  //Valid values: "#increment", "markup", ["label1", "label2", etc]
    	nextprev: ["Previous", "Next"],  //labels for "prev" and "next" links. Set to "" to hide.
    	revealtype: "click", //Behavior of pagination links to reveal the slides: "click" or "mouseover"
    	enablefade: [true, 0.2],  //[true/false, fadedegree]
    	autorotate: [true, 1000],  //[true/false, pausetime]
    	onChange: function(previndex, curindex){  //event handler fired whenever script changes slide
    		//previndex holds index of last slide viewed b4 current (1=1st slide, 2nd=2nd etc)
    		//curindex holds index of currently shown slide (1=1st slide, 2nd=2nd etc)
    	}
    })
    
    </script>
    The below two links when clicked on dynamically plays/ pauses the slider:

    Code:
    <a href="javascript:featuredcontentslider.playpause('slider1', 'play')">Play</a> <a href="javascript:featuredcontentslider.playpause('slider1', 'pause')">Pause</a>
    In your case, you'd just call this method when the tab script is clicked on.
    DD Admin

  3. #3
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you, worked perfectly !!

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
  •