Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: How to remove play/pause in Simple Controls Gallery

  1. #1
    Join Date
    Jun 2009
    Location
    Guernsey
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default How to remove play/pause in Simple Controls Gallery

    1) Script Title: Simple Controls Gallery v1.3

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

    3) Describe problem: I wish to remove the play/pause function on the navigation panel, and only have the prev/next buttons with the image status/counter replacing the play/pause button.

    I am very rusty on js stuff and have not found the answer, removing the nav panel results in the script not showing the images. I recognise there appear to be various parts of the code that are interlinked, I have been unable to successfully remove the correct parts.

    I know it may sound rather odd, as I guess there must have been a time when someone said the exact opposite.

    I would appreciate any help please.
    Last edited by Snookerman; 06-16-2009 at 06:42 AM.

  2. #2
    Join Date
    Jun 2009
    Location
    Guernsey
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    I assume that the problem is not an easy one! Would be a pity as its a neat script and almost perfect for the project I am working on.

    Surely someone must know how to do this, or is it impossible without a complete re-write?

    If not, does anyone know of a similar script with prev/next buttons but no play/pause/auto scroll.

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

    Default

    It's not quite so simple unfortunately, since the Play/ Pause buttons and the Status Counter exists inside two different DIVs and are treated by the script as separate "objects". Combining the two involves more than just rearranging the output of the HTML. Anyhow, I'll try and see if I can come up with the changes this weekend.
    DD Admin

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

    Default

    Ok, as promised, try the below modified .js file, which removes the pause/play buttons, and brings the status counter to within the same line as the next/prev buttons. You may want to edit the following line to tweak the spacing between the 3 controls:

    Code:
    				interfaceHTML+='<span class="gallerystatus" style="margin-right:5px">' + (setting.curimage+1) + '/' + setting.imagearray.length + '</span> '
    DD Admin

  5. The Following User Says Thank You to ddadmin For This Useful Post:

    zakky (06-14-2009)

  6. #5
    Join Date
    Jun 2009
    Location
    Guernsey
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    ddadmin - Thank you for much. However, just one thing, the status image count x/x does not move. I ran a clean test on a new html, but no change.
    On checking the code:

    addnavpanel:function(setting){.........
    if (i==1)
    interfaceHTML+='<span class="gallerystatus" style="margin-right:5px">' + (setting.curimage+1) + '/' + setting.imagearray.length + '</span> '

    The <span> replacing the <div>, is the only change I noted, but for some strange reason nothing happens!

    Do you know why this would be so?

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

    Default

    Hmm the status portion increments for me. Actually, there is another change to the code other than what you had mentioned. Specifically:

    Code:
    return setting.$navpanel.find('img.navimages, span.gallerystatus').get()
    DD Admin

  8. #7
    Join Date
    Jun 2009
    Location
    Guernsey
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    ddadmin - Try as I may, I cannot get the status to increment. I have used a brief test html page (copied below). For testing clarity, I have left the standard simplegallery.js as named whilst renaming the modified version to simplegallery_mod.js.

    If I run with simplegallery.js, the status increments, if I swap script to simplegallery_mod.js everything works except the increment.

    If you can find the time, do you have any idea as to what may be causing this problem? I re-downloaded the mod file today and still no difference.

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <script type="text/javascript" src="../jquery/jquery-1.3.2.js"></script>
    
        <style type="text/css">
          #simplegallery1{ //CSS for Simple Gallery Example 1
            position: relative; /*keep this intact*/
            visibility: hidden; /*keep this intact*/
            border: 10px solid darkred;
          }
        </style>
    
        <script type="text/javascript" src="simplegallery_mod.js">
        <!--<script type="text/javascript" src="simplegallery.js">-->
    
        /***********************************************
         * Simple Controls Gallery- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
         * This notice MUST stay intact for legal use
         * Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
         ***********************************************/
        </script>
    
        <script type="text/javascript">
          var mygallery=new simpleGallery({
    	      wrapperid: "simplegallery1",
    	      dimensions: [250, 180],
    	      imagearray: [
    		      ["http://i26.tinypic.com/11l7ls0.jpg", "http://en.wikipedia.org/wiki/Swimming_pool", "_new", "There's nothing like a nice swim in the Summer."],
    		      ["http://i29.tinypic.com/xp3hns.jpg", "http://en.wikipedia.org/wiki/Cave", "", ""],
    		      ["http://i30.tinypic.com/531q3n.jpg", "", "", "Eat your fruits, it's good for you!"],
    		      ["http://i31.tinypic.com/119w28m.jpg", "", "", ""]
    	      ],
    	      autoplay: [false, 2500, 2],
    	      persist: false,
    	      fadeduration: 500,
    	      oninit:function(){},
    	      onslide:function(curslide, i){
    	      }
          })
    </script>
    <body>
      <div id="simplegallery1"></div>
    </body>
    Last edited by Snookerman; 06-15-2009 at 07:58 PM.

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

    Default

    Can you upload a demo page containing the modified .js file, so I can see what the issue is live?
    DD Admin

  10. #9
    Join Date
    Jun 2009
    Location
    Guernsey
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    DD Admin - thanks for taking a look. The file is Vista Zipped with jquery plus nav images. I have included the js script within the html page (retested, but no luck).

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

    Default

    Ah ok I've finally found the problem. You're using jQuery 1.3.2 with this script, which changes slightly the order in which some elements are returned. As a result, the status portion is no longer found in the expected position by the script. Anyhow, inside the .js file, try finding the following line:

    Code:
    setting.navbuttons[3].innerHTML=(setting.curimage+1) + '/' + setting.imagearray.length
    and change that to:

    Code:
    setting.navbuttons[2].innerHTML=(setting.curimage+1) + '/' + setting.imagearray.length
    This change is only needed if you're using jQuery 1.3.2, and not 1.2.6.
    DD Admin

  12. The Following User Says Thank You to ddadmin For This Useful Post:

    zakky (06-15-2009)

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
  •