Results 1 to 7 of 7

Thread: Include play ,pause, next, previous functions alltogether for content gliding?

  1. #1
    Join Date
    Dec 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Include play ,pause, next, previous functions alltogether for content gliding?

    Hi All,

    Script title: "Featured Content Glider"

    Script Link:http://www.dynamicdrive.com/dynamici...tentglider.htm

    Concern:
    I could use the next and previous function in there, but for the same script how do we add play and pause function for content sliding, not for images.Aswell i see the number of slides stops after 2 cycles,untill we refresh it.

    How do we make it keep sliding always, if required it should be paused and then made to play without any number of cycles.

    I do not know how to code,If any one could help.


    Thank You,

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

    Default

    Well, you can easily set the script to cycle indefinitely by setting the below variable in your invocation code:

    Code:
    	autorotateconfig: [3000, 0] //if auto rotate enabled, set [milliseconds_btw_rotations, cycles_before_stopping]
    In other words, set the 2nd parameter to 0.

    Regarding a "play" and "pause" button, I'll have to add that as something to possibly add to the script the next time it's updated. The script was just updated yesterday for another feature.

  3. #3
    Join Date
    Aug 2007
    Location
    Kirkland Washington State
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Start/Stop Button Request

    I'd love to see a Start/Stop button added too. It would make this script much more useful to me. Thanks!

  4. #4
    Join Date
    May 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Pause button extension

    I've extended the Featured Content Glider code to allow for a pause button that stops and restarts the glider.

    I've attached a patch file for the featuredcontentglider.js file to add this extensions.

    To use the pause button you need to add the configuration for it to the featuredcontentglider.init section in your main html code (see pauseid). Here's an example:

    HTML Code:
    <script type="text/javascript">
    
    featuredcontentglider.init({
    	gliderid: "canadaprovinces", //ID of main glider container
    	contentclass: "glidecontent", //Shared CSS class name of each glider content
    	togglerid: "p-select", //ID of toggler container
    	pauseid: "pause", //ID of the pause container
    	remotecontent: "", //Get gliding contents from external file on server? "filename" or "" to disable
    	selected: 0, //Default selected content index (0=1st)
    	persiststate: false, //Remember last content shown within browser session (true/false)?
    	speed: 300, //Glide animation duration (in milliseconds)
    	direction: "rightleft", //set direction of glide: "updown", "downup", "leftright", or "rightleft"
    	autorotate: true, //Auto rotate contents (true/false)?
    	autorotateconfig: [3000, 2] //if auto rotate enabled, set [milliseconds_btw_rotations, cycles_before_stopping]
    })
    
    </script>
    
    <div id="canadaprovinces" class="glidecontentwrapper">
    
    <div class="glidecontent">
    <img src="http://i11.tinypic.com/8efzmmf.jpg" style="float: left; padding: 5px" />
    British Columbia is the westernmost of Canada's provinces and is famed for its natural beauty. It's capital is Victoria, located at the southeastern tip of Vancouver Island. BC's most populous city is Vancouver, located in southwest corner of the BC mainland called the Lower Mainland. 
    </div>
    
    <div class="glidecontent">
    <img src="http://i15.tinypic.com/72vilba.jpg" style="float: right; padding: 5px"/>
    Ontario is a province located in the central part of Canada, the largest by population and second largest, after Quebec in total area. Toronto, the capital of Ontario, is the centre of Canada's financial services and banking industry.
    </div>
    
    <div class="glidecontent">
    <img src="http://i17.tinypic.com/8bg0lkx.jpg" style="float: left; padding: 5px"/>
    Yukon, still commonly referred to as "The Yukon Territory", is the westernmost of Canada's three northern territories. The Yukon's major appeal is its nearly pristine nature. Tourism relies heavily on this and there are many organised outfitters and guides available to hunters and anglers and nature lovers of all sorts.
    </div>
    
    </div>
    
    <div id="p-select" class="glidecontenttoggler">
    <a href="#" class="prev">Prev</a> 
    <a href="#" class="toc">Page 1</a> <a href="#" class="toc">Page 2</a> <a href="#" class="toc">Page 3</a>
    <a href="#" class="next">Next</a>
    </div>
    <a id="pause">
    	<img src="images/but_pause.gif" alt=" Pause Button" width="14" height="11" border="0"/>
    </a>
    Note that the pause button link (or div or whatever) must be outside of the "p-select" element. I used css, however, to position the button on my page between the Previous and Next buttons.

  5. #5
    Join Date
    Mar 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Correction?! and Question...

    On this part in the js.txt file:

    Code:
    -	cancelautorotate:function(togglerid){
    -		if (window[togglerid+"timer"])
    -			clearInterval(window[togglerid+"timer"])
    +	cancelautorotate:function(config){
    +		if (window[config.togglerid+"timer"])
    +			clearInterval(window[config.togglerid+"timer"])
    +			config.paused = true;
     	},
    I think it should be this:

    Code:
    -	cancelautorotate:function(togglerid){
    -		if (window[togglerid+"timer"])
    -			clearInterval(window[togglerid+"timer"])
    +      },
    +	cancelautorotate:function(config){
    +		if (window[config.togglerid+"timer"])
    +			clearInterval(window[config.togglerid+"timer"])
    +			config.paused = true;
     	},
    Basically one little bracket and a comma added. After I did that, the script worked fine (no errors in IE).

    BUT, now that that's error free, it's not operating as it should. I have 4 images and a cycle of [1] and page 1 fades in, then to page 3, then to page 1 and then it stops?

    Any suggestions?

    If anybody thinks I may have copied it wrong, I will check it a third time, unless you may know the issue could be related to something else.

  6. #6
    Join Date
    Mar 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Hit Pause Button Once - Then It Works

    If I click the pause button once, it goes through all 4 pages and then stops (1 cycle).

    Thanks!
    Last edited by Sovereign; 03-08-2009 at 11:29 PM. Reason: Spelling

  7. #7
    Join Date
    Mar 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Before this thread gets burried

    Just wanted to see if anyone could help me, as this is still a problem. I won't bump it anymore after this - promise.

    Thanks you.

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
  •