Sliding Panels: On last panel - go to another html?

Hey everyone!
My first website is coming along nicely. Though my Creative Director has asked for a nice tweak to the site and I've hit a brick wall.
I've got a few product pages that's split into different categories - 8 html pages.
On each page I have the following 'back' and 'next' buttons to scroll through each product.
<div id="back"><a href="#" onclick="sp1.showPreviousPanel(); return false;"><img src="images/back.gif" width="107" height="42" alt="back" /></a></div>
<div id="next"><a href="#" onclick="sp1.showNextPanel(); return false;"><img src="images/next.gif" width="107" height="42" alt="next" /></a></div>
Is it possible, on the last panel/product, if you click 'next' again it loads up a new html page?
Maybe even the same for the 'back' button. So in theory you could scroll through every single product that's across 8 html pages.
I could easily specify which back and next page to load for each html page.
My site. (the first product page)
At the moment, theres a drop menu to navigate throughout.
Any help or ideas would be greatly appreciated!
Cheers,
Cam.

Do this:
<script>
var showNextPanel = function()
     var index = sp1.getContentPanelIndex(sp1.currentPanel) + 1;
     if( index >= sp1.getContentPanels().length ){
          window.location = 'newurl.html';
     return sp1.showPanel( index );
</script>
<a href="#" onclick="showNextPanel(); return false;">

Similar Messages

  • Getting a sliding panel loaded into an html panel to work.

    Hi. This is my first post on the forum.
    I've been using Spry a little here and there. Today I ran
    into a situation where I want to load an external page, that has a
    sliding panel in it, into an html panel. So far I have not had luck
    and I suppose it has to do with loading the js file. At the moment
    I have a right column that already has a sliding panel (working).
    But it would appear that the loaded external html file (in the left
    "main" column) is not picking that up. Any suggestions for a noob
    as to what to do next? Viewing the external page by itself allows
    the sliding panel to work (that is when I add the js file import to
    the head of the external html file... but that head section does no
    good when loaded into an html panel)
    Anyway, any help at all is greatly appreciated.
    Thanks,
    Eric

    Thank you very much! I found the topic
    here.
    It will require a bit of a small learning curve for me as html
    panel and sliding panels are my first interaction with js... even
    my rollovers are css driven. Thanks!

  • When transfering tracks across to ipod a sliding panel appears on the right hand side of itunes. after acknowleadging the transfer the panel does not slide back out of the way to alow another transfer.

    When transfering tracks to an ipod a sliding panel appears on the right hand side of itunes. This allows the selected track to be transfered. After registering this action the panel does not slide back out of the way to allow scrolling and more song selection. Any solutions..Help?

    I have an even simpler method. I use MyPublisher to print my books. I select their page layout for a two-page spread, drag and drop the image. DONE!  I understand that most people have their favorite places to have work done. I have been extremely pleased with MyPublisher.com, so I haven't even tried the book module in Lightroom.

  • Multiple sets of Spry Tabbed Sliding Panels?

    I have my code set up for one sliding panel set with three tabs but I want to copy that set and create another set of the same 3 sliding tabs right below it with different content. However, when I copy it to the next set, clicking the second set of tabs still causes the first sets sliding Panel to slide. Furthermore, a few elements of the css are no longer being read for the second set, including the script in the .SlidingPanels that hides any of the text box outside of the specified dimensions.
    Attached are a txt file for my html and css if that helps.
    Any help on this would be greatly appreciated.
    Thanks!
    [Moved to Spry forum by moderator]

    The constructor appears at the bottom of your sliding panel code, in exactly the format that Arnout has shown. You do not need to go into the javascript file for it.
    But the first thing I think you need to do is to make sure that you match the classes (and format) you are using with the classes per your sliding panels style sheet.
    Here is the essential markup (your content is not here; this is based on a plain example widget):
    <div style="margin: 0 auto; width: 350px; border: solid 1px red;">
    <a href="#" onclick="sp.showFirstPanel();">First Panel</a> | <a href="#" onclick="sp1.showPreviousPanel();">Previous Panel</a> | <a href="#" onclick="sp1.showNextPanel();">Next Panel</a> | <a href="#" onclick="sp1.showLastPanel();">Last Panel</a> | <a href="#" onclick="sp1.showPanel('p4');">Panel 4</a><!--example to show specific panel-->
    <div id="panelwidget" class="SlidingPanels" style="margin: 0 auto;">
    <div class="SlidingPanelsContentGroup">
        <div class="SlidingPanelsContent" id="p1">Panel 1</div>
        <div class="SlidingPanelsContent" id="p2">Panel 2</div>
        <div class="SlidingPanelsContent" id="p3">Panel 3</div>
        <div class="SlidingPanelsContent" id="p4">Panel 4</div>
        <div class="SlidingPanelsContent" id="p5">Panel 5</div>
        <div class="SlidingPanelsContent" id="p6">Panel 6</div>
            </div>
        </div>
        <script type="text/javascript">
       var sp1 = new Spry.Widget.SlidingPanels("panelwidget");
        </script>
    Note that the ID of the <div id="panelwidget" class="SlidingPanels"> matches the "panelwidget" in the constructor
    var sp1 = new Spry.Widget.SlidingPanels("panelwidget");
    For your second panelgroup, make <div id="panelwidget_01" class="SlidingPanels"> and change the constructor to
    var sp2 = new Spry.Widget.SlidingPanels("panelwidget_01");
    And of course the onclicks in the nav area should change for the second sliding panels set to use sp2 instead of sp1.
    I hope that Arnout will correct me if I have got it wrong!
    Best,
    Beth

  • Sliding Panels PanelKeyCodes

    Ola,
    Is it possible to set PanelKeyCode prev/next to mouse wheel
    event? Possible to step with the mouse wheel? If so please tell me
    the the value of previousPanelKeyCode and nextPanelKeyCode.
    Thnak you in advance!
    Cheers
    Kavichs: Data

    Hi, thanks for your reply.
    At the moment the player does stops when you go to another page (not slide) and doesnt keep playing. Its all working very well on the pages. See test page
    http://homepage.mac.com/nigelgrimshawjones/Candy_Lane/index.html
    Its just that on the shows events page there are sliding panels where we go through each show. For each new show (panle) she wants a different song to automatically play.
    I have set it up with a seperate player for each slide but unlike going from page to page, from slide to slide the music doesnt stop by itself. The test site has the old version with just one player at the top.
    There probably is something I could do in Flash but I dont know what. Its a complicated thing (for me)
    I was wondering if I could just use html music for those slides. I only need one song to play for each slide. But I need the song to stop when it goes to the next slide, (and the next song to start obviously)
    Any ideas are much appreciated. This job is supposed to be finished and its the last request from the client.
    Nige

  • Maintain Spry Sliding Panel Focus once a Form has been submitted - DW CS5

    I have a web page with 6 sliding panels.
    The last panel has an email form.
    Everything functions fine except for one item:
    Once a user hits the Submit button on the form in the last panel the panels slide back to the first (0-default) panel.
    How would I go about maintaining focus on that last panel (the one with the form on it) once the submit button is hit so that I can display the confirmation text? 
    Thanks in advance for any help or tips.

    The scripting of a CGI or PHP mail form server side stuff is designed to:
    a. open another page with a confirmation of the send     or
    b. refresh the page where the form is located so it appears as it did before the send.
    When you refresh the page outside of a submit function (F5), the page defaults to the first panel because that's the way the script is written. It is neither abrupt nor awkward. It is the correct functioning of the javascript that controls the accordion, or in this case a slider. 
    You can maybe rewrite that script to prevent it from doing so, but I personally don't know how to.
    As was pointed out by Nancy, keeping the form open in the panel, will more likely than not lead to viewers thinking that it didn't go, and they will submit the form multiple times, (thinkiing each time that it didn't work)  before getting frustrated and leaving the page and site altogether.
    If this is for simply aesthetic reasons, remember that "form follows function".  In a choice between what works and what looks good, what works should always take priority. It doesn't matter how nice it looks if it defeats its purpose with the design being flawed.

  • Sliding Panels and Detail Regions

    I'm trying to get a detailregion div to update whenever the
    panel in a sliding panels widget changes. Basically, whatever panel
    it's on, the detailregion div will change depending on what that
    panel is. Is this possible? I've tried using setrow but I'm not
    sure if I'm doing it right.

    Hi, thanks for your reply.
    At the moment the player does stops when you go to another page (not slide) and doesnt keep playing. Its all working very well on the pages. See test page
    http://homepage.mac.com/nigelgrimshawjones/Candy_Lane/index.html
    Its just that on the shows events page there are sliding panels where we go through each show. For each new show (panle) she wants a different song to automatically play.
    I have set it up with a seperate player for each slide but unlike going from page to page, from slide to slide the music doesnt stop by itself. The test site has the old version with just one player at the top.
    There probably is something I could do in Flash but I dont know what. Its a complicated thing (for me)
    I was wondering if I could just use html music for those slides. I only need one song to play for each slide. But I need the song to stop when it goes to the next slide, (and the next song to start obviously)
    Any ideas are much appreciated. This job is supposed to be finished and its the last request from the client.
    Nige

  • How to Create a DVD from sliding Panels Slideshow.

    I have the latest MacBook and iLife software.
    I have created a 650 picture slideshow in Sliding Panels theme. It is 1.1 GB.
    I have tried to (1) export and (2) Create iDVD through "Share". In both cases I get the message that I do not have sufficient Disc space. I have 23GB of available disc space.
    I am probably doing something wrong but any CLEAR instructions?
    Scottjohnw

    Welcome to the Apple Discussions. What system version are you running? As a precursor to trying the following fixes download and reapply the Mac OS X v10.6.3 v1.1 Update (Combo) updater if you're running Snow Leopard or the Mac OS X 10.5.8 Combo Update if you're running Leopard. Follow that with a repair of disk permissions. Then try the export again. If still not working continue with the fixes below:
    First delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your User/Library/Preferences folder and try again.
    If that doesn't help backup and launch iPhoto with the Command+Option keys depressed to rebuild the library. Select the last three options.
    Click to view full size

  • Safari 4 problems - HTMLDataSet/Sliding Panels

    Hi,
    I've been building a fairly basic photo gallery site and was having no problems with the site until I downloaded and installed Safari 4.  For some reason the detailRegions are not loading properly in Safari 4.  I have thumbnails in the sliding panels that load fine but the larger versions of the photos no longer appear in Safari below the sliding panels and on the right sidebar the paypal buttons no longer appear either.  IE and FF seem to be working fine still.  Any help would be greatly appreciated.  I'm very new to this so please bear with me if I have any glaring mistakes.  THANKS!!!
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Flowers</title>
    <link href="mainStyles.css" rel="stylesheet" type="text/css" />
    <!--[if IE]>
    <style type="text/css">
    /* place css fixes for all versions of IE in this conditional comment */
    #sidebar1 { padding-top: 30px; }
    #mainContent { zoom: 1; padding-top: 15px; }
    div.mainContent  { overflow:hidden; word-wrap: break-word;}
    /* the above proprietary zoom property gives IE the hasLayout it may need to avoid several bugs */
    </style>
    <![endif]-->
    <script src="SpryAssets/SprySlidingPanels.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryData.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryHTMLDataSet.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryDOMUtils.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">var ds1 = new Spry.Data.HTMLDataSet(null, "gallery", {columnNames: ['Thumbnail', 'PictureTitle', 'PictureResolution1', 'Price1', 'Button1', 'PictureResolution2', 'Price2', 'Button2', 'HiRes_Id',], rowSelector: "div.galleryItem", dataSelector: "p"});</script>
    </head>
    <body class="thrColHybHdr">
    <div id="container">
      <div id="header">
        <a href="index.html"><img src="images/dmlogo.jpg" width="400" height="100" alt="Eye Focus Photography" /></a></div>
    <!-- end #header -->
      <div id="sidebar1">
        <ul id="MenuBar1" class="MenuBarVertical">
          <li><a href="index.html">Home</a></li>
          <li><a href="animals.php">Animals</a></li>
          <li><a href="barns.php">Barns</a></li>
          <li><a href="cities.php" class="MenuBarItemSubmenu">Cities</a>
            <ul>
              <li><a href="washingtondc.php">Washington DC</a></li>
              <li><a href="nyc.php">New York City</a></li>
            </ul>
          </li>
          <li><a href="fireworks.php">Fireworks</a></li>
          <li><a href="flowers.php" class="selected">Flowers</a></li>
          <li><a href="lighthouses.php">Lighthouses</a></li>
          <li><a href="misc.php">Miscellaneous</a></li>
          <li><a href="national_parks.php">National Parks</a></li>
          <li><a href="plants.php">Plants</a></li>
          <li><a href="waterfalls.php">Waterfalls</a></li>
          <li><a href="contact.html">Contact</a></li>
        </ul>
      <!-- end #sidebar1 --></div>
      <div id="sidebar2">
         <div id="detailArea1" spry:detailregion="ds1">
              <div class="detailText">
             <h1>{PictureTitle}</h1>
             <p>{PictureResolution1}</p>
             <p>{Price1}</p>
            <p>{Button1}</p>
            <p>{PictureResolution2}</p>
             <p>{Price2}</p>
            <p>{Button2}</p>
             <br class="clearfloat"/>
             </div>
         </div>
      <!-- end #sidebar2 --></div>
      <div id="mainContent">
        <div id="slidingGallery" class="SlidingPanels" tabindex="0" spry:region="ds1">
           <div id="galleryContentGroup" class="SlidingPanelsContentGroup">
             <div id="panelContents" class="SlidingPanelsContent" spry:repeat="ds1" spry:setrow="ds1">
            <div class="galleryItem">
            <p class="thumbnail">{Thumbnail}</p>
            <p class="pictureTitle">{PictureTitle}</p>
            </div>
            </div>
         </div>
      </div>
      <p id="panelNav" class="fltlft">
           <a href="#" id="firstPanel" onclick="sp.showFirstPanel(); return false;">First</a>
           <a href="#" id="previousPanel" onclick="sp.showPreviousPanel(); return false;">Previous</a>
           <a href="#" id="nextPanel" onclick="sp.showNextPanel(); return false;">Next</a>
           <a href="#" id="lastPanel" onclick="sp.showLastPanel(); return false;">Last</a>
      </p>
    <div id="detailArea2" spry:detailregion="ds1">
         <div class="detailImg">
        <img src="images/flowers/{HiRes_Id}" alt="{PictureTitle}" /><br class="clearfloat"/>
        </div>
    </div>
    <div id="gallery">
    <div class="galleryItem">
    <p class="thumbnail"> <a href="images/flowers/3454_thumb.jpg"><img src="images/flowers/3454_thumb.jpg" alt="Daisy" width="145" height="97" class="thumbnail" /> </a> </p>
    <p class="pictureTitle">Daisy</p>
    <p class="pictureResolution">Resolution: 900x600</p>
    <p class="picturePrice">Price: $1.00</p>
    <p class="button">
    <span><form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_s-xclick"/>
    <input type="hidden" name="hosted_button_id" value="5397389"/>
    <input type="hidden" name="item_name" value="Daisy"/>
    <input type="hidden" name="custom" value="3454_900.jpg"/>
    <input type="hidden" name="amount" value="1.00"/>
    <input type="hidden" name="return" value=""/>
    <input type="hidden" name="lc" value="MY"/>
    <input type="hidden" name="rm" value="2"/>
    <input type="hidden" name="bn" value="PP-BuyNowBF"/>
    <input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"/>
    </form></span>
    </p>
    <p class="pictureResolution">Resolution: 2048x1365</p>
    <p class="picturePrice">Price: $5.00</p>
    <p class="button">
    <span><form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_s-xclick"/>
    <input type="hidden" name="hosted_button_id" value="5111872"/>
    <input type="hidden" name="item_name" value="Daisy"/>
    <input type="hidden" name="custom" value="3454_2048.jpg"/>
    <input type="hidden" name="amount" value="5.00"/>
    <input type="hidden" name="option_name_1" value="flowers"/>
    <input type="hidden" name="return" value=""/>
    <input type="hidden" name="lc" value="MY"/>
    <input type="hidden" name="rm" value="2"/>
    <input type="hidden" name="bn" value="PP-BuyNowBF"/>
    <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"/>
    </form></span>
    </p>
    <p class="pictureHires">3454_wm.jpg</p>
    </div>
    <div class="galleryItem">
    <p class="thumbnail"> <a href="images/flowers/6586_thumb.jpg"><img src="images/flowers/6586_thumb.jpg" alt="Sun Orchid" width="145" height="97" class="thumbnail" /> </a> </p>
    <p class="pictureTitle">Sun Orchid</p>
    <p class="pictureResolution">Resolution: 900x600</p>
    <p class="picturePrice">Price: $1.00</p>
    <p class="button">
    <span><form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_s-xclick"/>
    <input type="hidden" name="hosted_button_id" value="5397419"/>
    <input type="hidden" name="item_name" value="Sun Orchid"/>
    <input type="hidden" name="custom" value="6586_900.jpg"/>
    <input type="hidden" name="amount" value="1.00"/>
    <input type="hidden" name="return" value=""/>
    <input type="hidden" name="lc" value="MY"/>
    <input type="hidden" name="rm" value="2"/>
    <input type="hidden" name="bn" value="PP-BuyNowBF"/>
    <input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"/>
    </form></span>
    </p>
    <p class="pictureResolution">Resolution: 2048x1365</p>
    <p class="picturePrice">Price: $5.00</p>
    <p class="button">
    <span><form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_s-xclick"/>
    <input type="hidden" name="hosted_button_id" value="5397432"/>
    <input type="hidden" name="item_name" value="Sun Orchid"/>
    <input type="hidden" name="custom" value="6586_2048.jpg"/>
    <input type="hidden" name="amount" value="5.00"/>
    <input type="hidden" name="option_name_1" value="flowers"/>
    <input type="hidden" name="return" value=""/>
    <input type="hidden" name="lc" value="MY"/>
    <input type="hidden" name="rm" value="2"/>
    <input type="hidden" name="bn" value="PP-BuyNowBF"/>
    <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"/>
    </form></span>
    </p>
    <p class="pictureHires">6586_wm.jpg</p>
    </div>
    </div>
        <br class="clearfloat"/>
         <!-- end #mainContent --></div>
         <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
       <div id="footer">
        <p><!-- <span class="fltrt">ADD SOMETHING ELSE HERE</span>-->&copy; 2009</p>
      <!-- end #footer --></div>
         <!-- end #container --></div>
    <script type="text/javascript">
    <!--
    var sp = new Spry.Widget.SlidingPanels("slidingGallery");
    Spry.$$(".thumbnail a").removeAttribute("href");
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>
    </body>
    </html>

    It doesn't work correctly in Firefox either,
    If you check out generated code, you will see that the data ins't selected correctly, or that maybe your HTML is correctly.
    For example.. type this in the url bar of your browser; javascript:alert(ds1.getData()[0]['HiRes_Id']); and you will see it alerts <span></span>.
    So i would suggest to recheck your rowSelectors and validate your page for HTML errors. 
    Related documentation:
    http://labs.adobe.com/technologies/spry/samples/htmldataset/RowAndDataSelectorSamples.html

  • Sliding Panel Content Not Hidden

    Hi All. This is my first post so apologies if I do something wrong.
    I'm setting up sliding panels to work on my site (I've used them before) and this time I can't get the panels that aren't displayed to hide. The panels slide, but all panels are visable at all times. Here is the code -
    CSS
    .SlidingPanels {
        position: relative;
        width: 221px;
        height: 260px;
        padding: 0px;
        border: none;
    .SlidingPanelsContentGroup {
        position: relative;
        width: 10000px;
        margin: 0px;
        padding: 0px;
        border: none;
    .SlidingPanelsContent {
        width: 221px;
        height: 260px;
        overflow: hidden;
        margin: 0px;
        padding: 0px;
        border: none;
    .SlidingPanelsAnimating * {
        overflow: hidden !important;
    .SlidingPanelsCurrentPanel {
    .SlidingPanelsFocused {
    TEST.PHP
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <script src="http://www.guaranteedprofit.co.uk/Scripts/SprySlidingPanels.js" type="text/javascript"></script>
    <link href="http://www.guaranteedprofit.co.uk/sandbox.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <a href="#" onclick="sp1.showFirstPanel();">First Panel</a> | <a
        href="#" onclick="sp1.showPreviousPanel();">Previous Panel</a> |
    <a href="#" onclick="sp1.showNextPanel();">Next Panel</a> | <a href="#"
        onclick="sp1.showLastPanel();">Last Panel</a>
    <div id="panelwidget" class="SlidingPanels">
      <div class="SlidingPanelsContentGroup">
        <div class="SlidingPanelsContent" id="p1">Panel 1</div>
        <div class="SlidingPanelsContent" id="p2">Panel 2</div>
        <div class="SlidingPanelsContent" id="p3">Panel 3</div>
        <div class="SlidingPanelsContent" id="p4">Panel 4</div>
        <div class="SlidingPanelsContent" id="p5">Panel 5</div>
        <div class="SlidingPanelsContent" id="p6">Panel 6</div>
      </div>
    </div>
    <script type="text/javascript">
    var sp1 = new Spry.Widget.SlidingPanels("panelwidget");
    </script>
    Has anyone got any suggestions please as I know it's something simple, I just can't work it out. I've tested it in FF and IE6
    Thanks in advance, Adam

    Solved it. I've been at this since 5am and put a rouge <! -- in the css file which screwed it up

  • Sliding panel inside tabbed panel - onclick both

    I have two tabbed panels, tab one has a sliding panel function in it with 5 panels. I am wondering that when you are in tab 2 that you can have a button that clicks to tab 1 AND to sliding panel 3 at the same time? I can make them work independently, but can't get it to accomplish both. I don't have a site that I can post but I could dummy one up if that would help.
    OK I have another scenario as well....
    You are on tab 1, sliding panel 4 and then go to tab 2. When you go back to tab 1 it holds the sliding panel 4 active. Is there a way that when you go back to tab 1 and it to default back to sliding panel 1? Basically I don't want it to hold the position of sliding panel 4 on tab 1.

    Try this and adapt to your needs:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Document sans nom</title>
    <script type="text/javascript" src="SpryAssets/SpryDOMUtils.js"></script>
    <script type="text/javascript" src="SpryAssets/SprySlidingPanels.js"></script>
    <link href="SpryAssets/SprySlidingPanels.css" rel="stylesheet" type="text/css" />
    <script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
    <style>
    .SlidingPanels {
       position: relative;
       width: 200px;
       height: 200px;
       padding: 0px;
    .SlidingPanelsContentGroup {
       position: relative;
       height:600px;
       margin: 0px;
       padding: 0px;
    .SlidingPanelsContent {
       width: 100%;
       height: 400px;
       overflow: hidden;
       margin: 0px;
       padding: 0px;
    </style>
    </head>
    <body>
    <a href="#" id="trigger1">Click me to go to Tab 1 and Panel 3</a>
    <div id="TabbedPanels1" class="TabbedPanels">
      <ul class="TabbedPanelsTabGroup">
        <li class="TabbedPanelsTab" tabindex="0" id="trigger2">Click mo to go to Tab1 and Panel 1</li>
        <li class="TabbedPanelsTab" tabindex="0">Onglet 2</li>
      </ul>
      <div class="TabbedPanelsContentGroup">
        <div class="TabbedPanelsContent">Contenu 1
          <a href="#" onClick="sp1.showPanel(0);">Panel 1</a>
          <a href="#" onClick="sp1.showPanel(1);">Panel 2</a>
          <a href="#" onClick="sp1.showPanel(2);">Panel 3</a>
             <div id="slidingPanel_1" class="SlidingPanels">
                  <div class="SlidingPanelsContentGroup">
                     <div id="content1" class="SlidingPanelsContent">The Content 1</div>
                <div id="content2" class="SlidingPanelsContent">The Content 2</div>
                <div id="content3" class="SlidingPanelsContent">The Content 3</div>
            </div>
          </div>
        </div>
        <div class="TabbedPanelsContent">Contenu 2</div>
      </div>
    </div>
    <script type="text/javascript">
    var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
    var sp1 = new Spry.Widget.SlidingPanels("slidingPanel_1");
    Spry.Utils.addLoadListener(function() {
            Spry.$$("#trigger1").addEventListener('click', function() {
                TabbedPanels1.showPanel(0);
                sp1.showPanel(2);
            }, false);
            Spry.$$("#trigger2").addEventListener('click', function() {
                //TabbedPanels1.showPanel(0);
                sp1.showPanel(0);
            }, false);           
    </script>
    </body>
    </html>
    You may even do better using Spry.$$() CSS3-like selector (:first-child, nth-of-type(n), etc) to avoid adding ids on elements.
    Xav

  • Two sliding panels/w tabs widgets on the same page?

    I would like to use two of the same widget (Sliding Panels/w
    tabs) on the same page.
    How can I get two instances to function independently and not
    break each other....?
    I edited the sp_withTabs.js file by duplicating the first
    section below copying it, modifying it, and then pasting it below
    as the second section:
    // Turn the slidingPanel region into a real sliding panel
    widget.
    Spry.$$("#slidingPanel").addClassName("SlidingPanels");
    Spry.$$("#slidingPanel >
    div").addClassName("SlidingPanelsContentGroup");
    Spry.$$("#slidingPanel .SlidingPanelsContentGroup >
    div").addClassName("SlidingPanelsContent");
    sp2 = new Spry.Widget.SlidingPanels('slidingPanel');
    // Turn the slidingPanel2 region into a real sliding panel
    widget.
    Spry.$$("#slidingPanel2").addClassName("SlidingPanels");
    Spry.$$("#slidingPanel2 >
    div").addClassName("SlidingPanelsContentGroup");
    Spry.$$("#slidingPanel2 .SlidingPanelsContentGroup >
    div").addClassName("SlidingPanelsContent");
    sp2 = new Spry.Widget.SlidingPanels('slidingPanel2');
    This actually gets the second instance to function properly,
    but now the first instance is "frozen".

    Chapman, i know its been a while
    but where on the JS file is the part you changed?
    I cant find that in mine
    check out my page:
    http://www.pupr.edu/department/industrial/students.asp
    Im trying to do that same thing, but a sliding panel inside another one.
    The one inside isnt being recognized as a slliding panel, im thinking its the same problem you were having.
    If you need me to copy the .js file let me know!
    This is working with the Spry Sliding Panels Widget

  • Sliding Panels Problem: Content panels with different width?

    I'm trying to create the exact same behaviour as this Argentinian Photographer have done:
    http://germansaezphoto.com/music/radiohead/
    I've read and used the files in your tutorial: http://www.adobe.com/devnet/dreamweaver/articles/sliding_panel.html
    and searched the forum but couldn't find an answer.
    I'm almost there. The problem is that I have 6 test photos that are of the same height (and the same height as the slidingpanel view port) but different in width. If I set the class .SlidingPanelsContent to the same width as the largest picture(i.e. panel) then it creates a white space until the next pic starts. And If I set the width to the same as the smallest picture then it crops the other ones.
    Here is the div in the index file:
    <div class="SlidingPanels" id="panelwidget">
      <div class="SlidingPanelsContentGroup">
        <div class="SlidingPanelsContent" <img src="images/panel-2.jpg" width="645" height="430" /></div>
        <div class="SlidingPanelsContent" <img src="images/panel-1.jpg" width="594" height="430" /></div>
      <div class="SlidingPanelsContent" <img src="images/panel-3.jpg" width="645" height="430" /></div>
      <div class="SlidingPanelsContent" <img src="images/panel-4.jpg" width="645" height="430" /></div>
      <div class="SlidingPanelsContent" <img src="images/panel-5.jpg" width="645" height="430" /></div>
      <div class="SlidingPanelsContent" <img src="images/panel-6.jpg" width="594" height="430" /></div>
      </div>
      </div><br />
      <a href="#" onclick="sp1.showFirstPanel();">First Panel</a> | <a
        href="#" onclick="sp1.showPreviousPanel();">Previous Panel</a> |
    <a href="#" onclick="sp1.showNextPanel();">Next Panel</a> | <a href="#"
        onclick="sp1.showLastPanel();">Last Panel</a>
      <script type="text/javascript">
    var sp1 = new Spry.Widget.SlidingPanels("panelwidget");
    </script>
    And here is the classes in the css:
    .SlidingPanels {
         position: relative;
         float: left;
         width: 1000px;
         height: 430px;
         padding: 0px;
         border: none;
    .SlidingPanelsContentGroup {
         position: relative;
         float: left;
         width: 10000px;
         margin: 0px;
         padding: 0px;
         min-height:0;
         border: none;
    .SlidingPanelsContent {
         width: 645px;
         height: 430px;
         float: left;
         overflow: hidden;
         margin: 0px;
         padding: 0px;
         border: none;
    In the css file before the .SlidingPanelsContent class Adobe states that they in their default implementation has set the width to the same as the view port to ensure that only one panel at a time can be viewed within the view port. But I want the opposite.
    How do I solve this?

    It seems to me that if you have all different width images, you will want to remove the width from the content pane. That should allow the images to butt up next to each other without either extra white space (for smaller images) or cropping (of larger images). Saenz's photos are in divs with a class of .panelfoto that has the definition of float: left; width: auto;
    I have not played around a lot with sliding panels, but it seems reasonable to me that that would work.
    You have probably already read and digested this page: http://labs.adobe.com/technologies/spry/articles/sliding_panels/index.html
    You know, if you really want something very close to what the example site looks like, look into his code and imitate it.
    It does not appear that every move of the pane goes the same distance, and I'm not sure what controls that, but I see some of his images moving part-way, exposing part of the next, and so forth, instead of a complete image change each time. Using different width photos will do that partly, of course.
    Beth

  • Jump Menu for Sliding Panels Widget

    I have used the sliding panels tutorial to build a 15 page
    sliding document inside a new site I am building. It works
    briliantly. However I want to be able to use a jump menu to access
    any of the 15 pages as well as use the next and previous buttons.
    I tried by inserting a form, then jump menu but couldnt put
    it all together code wise.
    Is it possible to use a jump menu for this widget (Im sure it
    must be) and what bits do I put where? Any ideaas greatly
    appreciated.
    Nigel

    OK Ive given it a shot but I dont where to put that code in
    the mix so to speak.
    The widget code skeleton is below: as per the tutorial.
    Where exactly in this mix would I put the code you suggested.
    Im not sure if its css, html or js.
    Sorry Im such a novice at this business but I would be very
    grateful for a bit more help here.
    Nige
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=UTF-8" />
    <title>Untitled Document</title>
    <script type="text/javascript"
    src="SpryAssets/SprySlidingPanels.js"></script>
    <link type="text/css" rel="stylesheet"
    href="SpryAssets/SprySlidingPanels.css">
    <script type="text/javascript">
    <!--
    function MM_jumpMenu(targ,selObj,restore){ //v3.0
    eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
    if (restore) selObj.selectedIndex=0;
    //-->
    </script>
    </head>
    <body>
    <a href="#" onclick="sp1.showFirstPanel();">First
    Panel</a>|<a href="#"
    onclick="sp1.showPreviousPanel();">Previous Panel</a>|
    <a href="#" onclick="sp1.showNextPanel();">Next
    Panel</a>| <a href="#"
    onclick="sp1.showLastPanel();">Last Panel</a>|
    <div id="panelwidget" class="SlidingPanels">
    <div class="SlidingPanelsContentGroup">
    <div class="SlidingPanelsContent" id="p1">Panel
    1</div>
    <div class="SlidingPanelsContent" id="p2">Panel
    2</div>
    <div class="SlidingPanelsContent" id="p3">Panel
    3</div>
    <div class="SlidingPanelsContent" id="p4">Panel
    4</div>
    <div class="SlidingPanelsContent" id="p5">Panel
    5</div>
    <div class="SlidingPanelsContent" id="p6">Panel
    6</div>
    </div>
    </div>
    <script type="text/javascript">
    var sp1 = new Spry.Widget.SlidingPanels("panelwidget");
    </script>
    </body>
    </html>

  • Sliding Panel needs feedback

    Here is my class for a sliding panel. The class is released as open source. Please feel free to feed this into your IDE and provide feedback for improvement.
    Known issues include: double clicking the component2 to be shown, some flickering in graphics.
    import javax.swing.*;
    import java.awt.*;
    public class JSlidingPanel extends JPanel{
         private JComponent component1, component2;
         private Dimension dim1, dim2;     
         private int rate  = 30, delay=35;      //deals with showing speed. How smooth should animation occur. default 7. delay = 5;     //also deals with showing speed. How fast to show component2.          default 10     
         private boolean shown, showing, hiding, newComponent;
         private GridBagLayout grid;
         private GridBagConstraints c;
         static JPanel p2;
         public static void main(String[] a){
              final JSlidingPanel s = new JSlidingPanel();
              JLabel label = new JLabel("Put Mouse HERE");
                   label.addMouseListener(new java.awt.event.MouseAdapter(){
                        public void mouseEntered(java.awt.event.MouseEvent e){
                             s.showComponent2();
                             if(s.getComponent2() == null){
                                  s.setComponent2(p2);
                                  s.getComponent2().setSize(new Dimension(100, 100));
                        }public void mouseExited(java.awt.event.MouseEvent e){
                             s.hideComponent2();
              JPanel p1 = new JPanel();
                   p1.add(label);
                   p1.setOpaque(true);
                   p1.setBackground(Color.red);
              p2 = new JPanel();
                   p2.setOpaque(true);
                   p2.setBackground(Color.green);
                   p2.setLayout(new BoxLayout(p2, BoxLayout.Y_AXIS));
                   JPanel p2_1 = new JPanel();
                        p2_1.add(new JLabel("HELLO Olvin"));
                        p2_1.setOpaque(true);
                        p2_1.setBackground(Color.white);
                   JPanel p2_2 = new JPanel();
                        p2_2.add(new JLabel("HELLO Olvin"));
                        p2_2.setOpaque(true);
                        p2_2.setBackground(Color.gray);
                   JPanel p2_3 = new JPanel();
                        p2_3.add(new JLabel("HELLO Olvin"));
                        p2_3.setOpaque(true);
                        p2_3.setBackground(Color.black);
                   p2.add(p2_1);
                   p2.add(p2_2);
                   p2.add(p2_3);
                   p2.setMinimumSize(new Dimension(100, 200));
                   p2.setMaximumSize(new Dimension(100, 200));
                   p2.setPreferredSize(new Dimension(100, 200));
                   p2.setSize(new Dimension(100, 200));
                        s.setComponent1(p1);
                        s.setComponent2(null);
                        //s.getComponent2().setSize(new Dimension(100, 100));                    
                   JPanel panel = new JPanel();
                        panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
                        panel.add(new JLabel("Hola"));
                        panel.add(s);
                        panel.add(new JLabel("<html><div style='height: 40px; background:#0000FF;'> </div></html>"));
                   JFrame f=new JFrame("");
                        f.setContentPane(panel);
                        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                        f.setSize(650,500);
                      f.setVisible(true);
         public JSlidingPanel(){
              super();
              newComponent=false;
              grid = new GridBagLayout();
              c = new GridBagConstraints();
                   c.fill=GridBagConstraints.HORIZONTAL;
                   c.anchor=GridBagConstraints.NORTH;
                   c.weightx=1;
                   c.weighty=0;
              setLayout(grid);
         public void paintComponent(Graphics g){
              super.paintComponent(g);
              if(newComponent && component2 != null){
                   try{
                        dim1 = new Dimension(component1.getSize().width, component1.getSize().height);
                        dim2 = new Dimension(component2.getSize().width, component2.getSize().height);
                        realizeDimensions();
                   }catch(Exception ex){JOptionPane.showMessageDialog(null, "Component1 not set");}
                   newComponent=false;
         public synchronized boolean isComponentShown(){
              return shown;
         public synchronized void setComponent1(JComponent panel) {
              if(panel==null){
                   panel=new JPanel();
                   panel.setOpaque(false);
              component1 = panel;
              c.gridx=0;
              c.gridy=0;
              c.gridwidth=1;
              c.gridheight=1;
              c.fill=GridBagConstraints.HORIZONTAL;
              grid.setConstraints(component1, c);
              add(component1, 0);
         public synchronized JComponent getComponent2() {
              return component2;
         public synchronized void setComponent2(JComponent panel) {
              if(panel==null){
                   panel=new JPanel();
                   panel.setName("null");
                   panel.setOpaque(false);
              if(component1 == null){
                   setComponent1(null);
              }if(component2 != null){
                   this.remove(component2);
              newComponent=true;
              component2 = panel;
                   c.gridx=0;
                   c.gridy=1;
                   c.gridwidth=1;
                   c.gridheight=1;
                   c.fill=GridBagConstraints.HORIZONTAL;
                   grid.setConstraints(component2, c);
                   add(component2, 1);               
                   updateUI();//repaint components. Needed
         public synchronized void hideComponent2(){
              if(showing || hiding || component2==null)return;
              Thread t1 = new Thread(){
                   public void run(){
                        hiding=true;
                        int counter = dim2.height-rate;
                        while(component2.getSize().height > 0){
                             if( counter < 0 ){
                                  int extra = counter;
                                  int exact_amount =  (counter - extra) ;
                                  counter = exact_amount;
                             component2.setPreferredSize(new Dimension(dim2.width, counter));
                             component2.setMinimumSize(new Dimension(dim2.width, counter));
                             component2.setMaximumSize(new Dimension(dim2.width, counter));
                             component2.setSize(new Dimension(dim2.width, counter));
                             setPreferredSize(new Dimension(dim1.width, dim1.height+component2.getSize().height));
                             setMinimumSize(new Dimension(dim1.width, dim1.height+component2.getSize().height));
                             setMaximumSize(new Dimension(dim1.width, dim1.height+component2.getSize().height));
                             setSize(new Dimension(dim1.width, dim1.height+component2.getSize().height));
                             component2.updateUI();
                             try{
                                  Thread.sleep(delay);
                             }catch(Exception ex){}
                             counter -= rate;
                        hiding=false;
                        shown=false;
              };t1.start();
         public synchronized void showComponent2(){
              if(showing || hiding || component2==null || dim2==null)return;
              Thread t1 = new Thread(){
                   public void run(){
                        showing=true;
                        int counter = rate;
                        while(component2.getSize().height < dim2.height){
                             if( counter > dim2.height ){
                                  int extra =  (counter-dim2.height);
                                  int exact_amount =  counter-extra;
                                  counter = exact_amount;
                             component2.setPreferredSize(new Dimension(dim2.width, counter));
                             component2.setMinimumSize(new Dimension(dim2.width, counter));
                             component2.setMaximumSize(new Dimension(dim2.width, counter));
                             component2.setSize(new Dimension(dim2.width, counter));
                             setPreferredSize(new Dimension(dim1.width, dim1.height+counter));
                             setMinimumSize(new Dimension(dim1.width, dim1.height+counter));
                             setMaximumSize(new Dimension(dim1.width, dim1.height+counter));
                             setSize(new Dimension(dim1.width, dim1.height+counter));
                             component2.updateUI();
                             try{
                                  Thread.sleep(delay);
                             }catch(Exception ex){}
                             counter += rate;
                        showing=false;
                        shown = true;
              };t1.start();
         private void realizeDimensions(){
              component2.setPreferredSize(new Dimension(dim2.width,0));
              component2.setMinimumSize(new Dimension(dim2.width,0));
              component2.setMaximumSize(new Dimension(dim2.width,0));
              component2.setSize(new Dimension(dim2.width,0));
              setPreferredSize(dim1);
              setMinimumSize(dim1);
              setMaximumSize(dim1);
              setSize(dim1);
              updateUI();
    }

    Im sorry guys for not replying it was probably because I didnt add this topic to my Watchlist. Now it is. Anyhow, I wrote a slightly different main() so you can test the custom JPanel again. This time it displays a red label. Once you place the mouse over it, it should make another JLabel (green colored) )visible. Known issues still include unwanted flickering, use of threads(instead of timers), and too many lines of code(7.5KB). This code is public domain so the community can make any changes. Please post your code modifications in this forum.
    It runs fine under Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
    import javax.swing.*;
    import java.awt.*;
    public class JSlidingPanel extends JPanel{
         private static final long serialVersionUID = 1L;
         private JComponent component1, component2;
         private Dimension dim1, dim2;     
         private int rate  = 20;
         private int delay = 10;
         private boolean shown;
         private boolean showing;
         private boolean hiding;     
         private GridBagLayout grid;
         private GridBagConstraints c;     
         private boolean newComponent;
         public static void main(String[] a){
              final JSlidingPanel s = new JSlidingPanel();
              JLabel label = new JLabel("Put Mouse HERE");
                   label.addMouseListener(new java.awt.event.MouseAdapter(){
                        public void mouseEntered(java.awt.event.MouseEvent e){
                             s.showComponent2();
                        }public void mouseExited(java.awt.event.MouseEvent e){
                             s.hideComponent2();
              JPanel p1 = new JPanel();
                   p1.add(label);
                   p1.setOpaque(true);
                   p1.setBackground(Color.red);
              JPanel p2 = new JPanel();
                   p2.setOpaque(true);
                   p2.setBackground(Color.green);
                   p2.setLayout(new BoxLayout(p2, BoxLayout.Y_AXIS));
                   p2.add(new JLabel("<html><h1>My HTML Label</h1><p>This component is a JLabel inside a JPanel.</p>"));               
                        s.setComponent1(p1);
                        s.setComponent2(p2);
                        s.getComponent2().setSize(new Dimension(100, 300));
                   JFrame f=new JFrame("");
                        f.setContentPane(s);
                        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                        f.setSize(650,500);
                      f.setVisible(true);
         public JSlidingPanel(){
              super();
              newComponent=false;
              grid = new GridBagLayout();
              c = new GridBagConstraints();
                   c.fill=GridBagConstraints.HORIZONTAL;
                   c.anchor=GridBagConstraints.NORTH;
                   c.weightx=1;
                   c.weighty=0;
              setLayout(grid);
         public void paintComponent(Graphics g){
              super.paintComponent(g);
              if(newComponent && component2 != null){
                   try{
                        dim1 = new Dimension(component1.getSize().width, component1.getSize().height);
                        dim2 = new Dimension(component2.getSize().width, component2.getSize().height);
                        realizeDimensions();
                   }catch(Exception ex){JOptionPane.showMessageDialog(null, "Component1 not set");}
                   newComponent=false;
         public int getDelay() {
              return delay;
         public void setDelay(int delay) {
              this.delay = delay;
         public int getRate() {
              return rate;
         public void setRate(int rate) {
              this.rate = rate;
         public synchronized boolean isComponentShown(){
              return shown;
         public synchronized boolean isComponentHidden(){
              return !shown;
         public synchronized boolean isComponentShowing() {
              return showing;
         public synchronized boolean isComponentHiding() {
              return hiding;
         public synchronized JComponent getComponent1() {
              return component1;
         public synchronized void setComponent1(JComponent panel) {
              if(panel==null){
                   panel=new JPanel();
                   panel.setOpaque(false);
              component1 = panel;
              c.gridx=0;
              c.gridy=0;
              c.gridwidth=1;
              c.gridheight=1;
              c.fill=GridBagConstraints.HORIZONTAL;
              grid.setConstraints(component1, c);
              add(component1, 0);
         public synchronized JComponent getComponent2() {
              return component2;
         public synchronized void setComponent2(JComponent panel) {
              if(panel==null){
                   panel=new JPanel();
                   panel.setName("null");
                   panel.setOpaque(false);
              if(component1 == null){
                   setComponent1(null);
              }if(component2 != null){
                   this.remove(component2);
              newComponent=true;
              component2 = panel;
                   c.gridx=0;
                   c.gridy=1;
                   c.gridwidth=1;
                   c.gridheight=1;
                   c.fill=GridBagConstraints.HORIZONTAL;
                   grid.setConstraints(component2, c);
                   add(component2, 1);               
                   updateUI();
         public synchronized void hideComponent2(){
              if(isComponentShowing() || isComponentHiding() || getComponent2()==null)return;
              Thread t1 = new Thread(){
                   public void run(){
                        hiding=true;
                        int counter = dim2.height-rate;
                        while(component2.getSize().height > 0){
                             if( counter < 0 ){
                                  int extra = counter;
                                  int exact_amount =  (counter - extra) ;
                                  counter = exact_amount;
                             component2.setPreferredSize(new Dimension(dim2.width, counter));
                             component2.setMinimumSize(new Dimension(dim2.width, counter));
                             component2.setMaximumSize(new Dimension(dim2.width, counter));
                             component2.setSize(new Dimension(dim2.width, counter));
                             setPreferredSize(new Dimension(dim1.width, dim1.height+component2.getSize().height));
                             setMinimumSize(new Dimension(dim1.width, dim1.height+component2.getSize().height));
                             setMaximumSize(new Dimension(dim1.width, dim1.height+component2.getSize().height));
                             setSize(new Dimension(dim1.width, dim1.height+component2.getSize().height));
                             component2.updateUI();
                             try{
                                  Thread.sleep(delay);
                             }catch(Exception ex){}
                             counter -= rate;
                        hiding=false;
                        shown=false;
              };t1.start();
         public synchronized void showComponent2(){
              if(isComponentShowing() || isComponentHiding() || getComponent2()==null || dim2==null)return;
              Thread t1 = new Thread(){
                   public void run(){
                        showing=true;
                        int counter = rate;
                        while(component2.getSize().height < dim2.height){
                             if( counter > dim2.height ){
                                  int extra =  (counter-dim2.height);
                                  int exact_amount =  counter-extra;
                                  counter = exact_amount;
                             component2.setPreferredSize(new Dimension(dim2.width, counter));
                             component2.setMinimumSize(new Dimension(dim2.width, counter));
                             component2.setMaximumSize(new Dimension(dim2.width, counter));
                             component2.setSize(new Dimension(dim2.width, counter));
                             setPreferredSize(new Dimension(dim1.width, dim1.height+counter));
                             setMinimumSize(new Dimension(dim1.width, dim1.height+counter));
                             setMaximumSize(new Dimension(dim1.width, dim1.height+counter));
                             setSize(new Dimension(dim1.width, dim1.height+counter));
                             component2.updateUI();
                             try{
                                  Thread.sleep(delay);
                             }catch(Exception ex){}
                             counter += rate;
                        showing=false;
                        shown = true;
              };t1.start();
         private void realizeDimensions(){
              component2.setPreferredSize(new Dimension(dim2.width,0));
              component2.setMinimumSize(new Dimension(dim2.width,0));
              component2.setMaximumSize(new Dimension(dim2.width,0));
              component2.setSize(new Dimension(dim2.width,0));
              setPreferredSize(dim1);
              setMinimumSize(dim1);
              setMaximumSize(dim1);
              setSize(dim1);
              updateUI();
    }

Maybe you are looking for