Skip navigation
marathonmannen
Currently Being Moderated

Sliding Panels Problem: Content panels with different width?

May 30, 2010 10:54 AM

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?

 
Replies
  • Currently Being Moderated
    May 31, 2010 11:58 AM   in reply to marathonmannen

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 5, 2010 10:00 AM   in reply to marathonmannen

    Good job!

    Beth

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 27, 2012 7:05 AM   in reply to Zabeth69

    Zabeth!

    Im having this problem but instead of width, its with height.

    I already did the height auto in css

     

    But its not working right,

    the slidingpanel takes the height of the longest panel and the rest of the panels stay with that height instead of decreasing to its own.

    how could i do this?

    So that each panel resizes its height automatically?

     

    www.pupr.edu/department/industrial/students.asp

     

    I have the same problem with an accordeon menu i did, the content is in height auto but it keeps the auto-height of the default open panel making the second panel have to scroll instead of expanding to its own height :/

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points