Sliding Panel Animation

I'm trying to adjust the easing of the sliding panel
animation. I'm hoping it will start up a little slower before
zipping off screen.
I'm trying to replicate the motion of this slider:
http://www.ndoherty.com/demos/coda-slider/1.1/
I think the needed changes are in this part of
SprySlidingPanels.js, but I can't figure it out. Can anybody help?
Thanks!!
Spry.Widget.SlidingPanels.PanelAnimator
= function(ele, curX, curY, dstX, dstY, opts)
this.element = ele;
this.curX = curX;
this.curY = curY;
this.dstX = dstX;
this.dstY = dstY;
this.fps = 60;
this.duration = 500;
this.transition =
Spry.Widget.SlidingPanels.PanelAnimator.defaultTransition;
this.startTime = 0;
this.timerID = 0;
this.finish = null;
var self = this;
this.intervalFunc = function() { self.step(); };
Spry.Widget.SlidingPanels.setOptions(this, opts, true);
this.interval = 1000/this.fps;
Spry.Widget.SlidingPanels.PanelAnimator.defaultTransition =
function(time, begin, finish, duration) { time /= duration; return
begin + ((2 - time) * time * finish); };
Spry.Widget.SlidingPanels.PanelAnimator.prototype.start =
function()
this.stop();
this.startTime = (new Date()).getTime();
this.timerID = setTimeout(this.intervalFunc, this.interval);
Spry.Widget.SlidingPanels.PanelAnimator.prototype.stop =
function()
if (this.timerID)
clearTimeout(this.timerID);
this.timerID = 0;
Spry.Widget.SlidingPanels.PanelAnimator.prototype.step =
function()
var elapsedTime = (new Date()).getTime() - this.startTime;
var done = elapsedTime >= this.duration;
var x, y;
if (done)
x = this.curX = this.dstX;
y = this.curY = this.dstY;
else
x = this.transition(elapsedTime, this.curX, this.dstX -
this.curX, this.duration);
y = this.transition(elapsedTime, this.curY, this.dstY -
this.curY, this.duration);
this.element.style.left = x + "px";
this.element.style.top = y + "px";
if (!done)
this.timerID = setTimeout(this.intervalFunc, this.interval);
else if (this.finish)
this.finish();

Another change I made based on nice features of the Coda
Slider I referenced above:
Able to Link/Bookmark particular panels
We want to add an anchor hashes (#1, #2, #3 etc) to the url
for each panel, and then in the js file, extract the hash and make
it the default.
IN THE HTML:
<!-- Panel Navigation -- hashes added to url and return
now set to true -->
<a href="#1" onclick="sp2.showPanel(0); return
true;">1</a> |
<a href="#2" onclick="sp2.showPanel(1); return
true;">2</a> |
<a href="#3" onclick="sp2.showPanel(2); return
true;">3</a> |
<a href="#4" onclick="sp2.showPanel(3); return
true;">4</a> |
<a href="#5" onclick="sp2.showPanel(4); return
true;">5</a>
<!-- Panels themselves stay the same. This example shows
images. -->
<div id="example2" class="SlidingPanels" tabindex="0">
<div class="SlidingPanelsContentGroup">
<div id="ex2_p1" class="SlidingPanelsContent
p1"><img src="image1.jpg" ></div>
<div id="ex2_p2" class="SlidingPanelsContent
p2"><img src="image2.jpg"></div>
<div id="ex2_p3" class="SlidingPanelsContent
p3"><img src="images3.jpg"></div>
<div id="ex2_p4" class="SlidingPanelsContent
p4"><img src="images4.jpg"></div>
<div id="ex2_p5" class="SlidingPanelsContent
p5"><img src="image5.jpg"></div>
</div>
</div>
IN THE Spry.SlidingPanels.js FILE:
// Add this right before the part about default
// NEW STUFF HERE
// Grabs the number after the hash and makes it the default
// Note: had to add the hashes to the <a href> and set
return to true
this.defaultPanel = parseInt(location.hash.slice(1));
this.defaultPanel = this.defaultPanel-1;
// my hash numbers start at 1 but the array starts at 0, so
subtracted 1 from mine
// Back to regularly scheduled programming
// END NEW STUFF
Hope this helps someone.

Similar Messages

  • Spry Sliding Panel bugs with Flash SWF, iFrames, CSS background images

    Greetings,
    I'm working on a site right now that is build with Spry 1.6
    Sliding Panels. On the home panel I have integrated a looping SWF,
    and scrolling iFrames on the Overview panel. After extensive
    research on these forums, I'm still scratching my head at a few
    bugs listed below:
    • Firefox (MAC v2.0.0.14)
    - The SWF on the home panel doesn't hide properly when
    sliding to a different panel. I have set 'wmode opaque' parameters
    to the flash file, but this seems to have not resolved the issue.
    - Additionally, I've noticed that sometimes the SWF will not
    finish sliding into the correct position when clicking to the home
    panel (the SWF will stop sliding several pixels left of the
    original positioning).
    - The SWF (which happens to be a loop animation) resets every
    time the home panel is visited. In my testing, this does not happen
    in any other browser.
    - On the Overview panel, scrolling iFrames are used on the
    "Staff Profiles". These iFrames don't hide properly when clicking
    through other panels, as the scroll bars are still viewable.
    - Overall, the sliding animation is a bit choppy compared to
    all other browsers. I can live with this, but I wonder if I have
    improper code somewhere?
    • Opera (MAC v9.27)
    - Same issue as above concerning the fact that the SWF
    appears outside of the sliding panel view port.
    • IE 6
    - CSS background images flash during the sliding panel
    animation.
    * Site page links *
    Main URL
    Home
    Page iFrame
    Overview
    Page iFrame
    * CSS *
    Main
    site-wide CSS
    Sliding
    Panels CSS
    * Scripts *
    Sliding
    Panels Sript
    Any suggestions, pointers would be much appreciated!
    Cheers,
    Chris

    Greetings,
    I'm working on a site right now that is build with Spry 1.6
    Sliding Panels. On the home panel I have integrated a looping SWF,
    and scrolling iFrames on the Overview panel. After extensive
    research on these forums, I'm still scratching my head at a few
    bugs listed below:
    • Firefox (MAC v2.0.0.14)
    - The SWF on the home panel doesn't hide properly when
    sliding to a different panel. I have set 'wmode opaque' parameters
    to the flash file, but this seems to have not resolved the issue.
    - Additionally, I've noticed that sometimes the SWF will not
    finish sliding into the correct position when clicking to the home
    panel (the SWF will stop sliding several pixels left of the
    original positioning).
    - The SWF (which happens to be a loop animation) resets every
    time the home panel is visited. In my testing, this does not happen
    in any other browser.
    - On the Overview panel, scrolling iFrames are used on the
    "Staff Profiles". These iFrames don't hide properly when clicking
    through other panels, as the scroll bars are still viewable.
    - Overall, the sliding animation is a bit choppy compared to
    all other browsers. I can live with this, but I wonder if I have
    improper code somewhere?
    • Opera (MAC v9.27)
    - Same issue as above concerning the fact that the SWF
    appears outside of the sliding panel view port.
    • IE 6
    - CSS background images flash during the sliding panel
    animation.
    * Site page links *
    Main URL
    Home
    Page iFrame
    Overview
    Page iFrame
    * CSS *
    Main
    site-wide CSS
    Sliding
    Panels CSS
    * Scripts *
    Sliding
    Panels Sript
    Any suggestions, pointers would be much appreciated!
    Cheers,
    Chris

  • Sliding Panels Auto Advance w/ Timer

    Hi everyone. I'm looking to make my sliding panels advance
    with a simple timer. I know this can be done (right?) but can't
    find any way to do this. I have text content in my panels (no
    images) so the posted example of a gallery doesn't help me much.
    I have no problem setting up the panels as I want, I just
    want to make them advance every few seconds.
    Anyone please help!!
    Thanks so much,
    Varen Swaab

    Instead of creating a custom script, I decided to extend the widget it self. So everything can be controlled from the widget constructor.
    Before we get started a small side note:
    I would advice to put the changes in a seperate script, and not to modify the current SlidingPanels.js. This way, if you happen to update to Spry 1.7 it will not overwrite the change you made. But if you do not wish to update just paste it in the SprySlidingPanels.js (This saves a HTTP request, resulting in a slightly faster page load, maintainablity vs performance)
    The changes allow you specify the following new options in the constructor:
    - automatic: true / false [boolean]
    turns automatic sliding panels on or off, off by default
    - direction: 0 / 1 [number or Spry.forward , Spry.backward if you have SpryEffects included]
    direction that panels should automaticly slide to, 1 is forward, 2 is backward
    - each: 1000 [number]
    time in miliseconds, note I had to name this "each" instead of duration, because duration handles the sliding panel animation duration.
    Example constructor:
    var sp1 = new Spry.Widget.SlidingPanels("SlidingPanels1", { automatic: false, direction: 0, each: 5000 });
    It also adds 3 new methods to the sliding panel:
    - .start  [ sp1.start(); ]
    This allows you to start the automatic sliding of the panels, this will also work, if you did not specify automatic in your constructor
    - .stop  [ sp1.stop(); ]
    Stops automatic sliding of the panels
    - .setDirection [ sp1.setDirection(1); ]
    Sets a new direction for the sliding panels, requires the same values as you can specify in the sliding panels constructor
    The new code:
    // line 121 of SprySlidingPanels.js
    Spry.Widget.SlidingPanels.prototype.attachBehaviors = function()
         var ele = this.element;
         if (!ele)
              return;
         if (this.enableKeyboardNavigation)
              var focusEle = null;
              var tabIndexAttr = ele.attributes.getNamedItem("tabindex");
              if (tabIndexAttr || ele.nodeName.toLowerCase() == "a")
                   focusEle = ele;
              if (focusEle)
                   var self = this;
                   Spry.Widget.SlidingPanels.addEventListener(focusEle, "focus", function(e) { return self.onFocus(e || window.event); }, false);
                   Spry.Widget.SlidingPanels.addEventListener(focusEle, "blur", function(e) { return self.onBlur(e || window.event); }, false);
                   Spry.Widget.SlidingPanels.addEventListener(focusEle, "keydown", function(e) { return self.onKeyDown(e || window.event); }, false);
         if (this.currentPanel)
              // Temporarily turn off animation when showing the
              // initial panel.
              var ea = this.enableAnimation;
              this.enableAnimation = false;
              this.showPanel(this.currentPanel);
              this.enableAnimation = ea;
         if (this.automatic){
              this.start();
    // These are all new methods
    Spry.Widget.SlidingPanels.prototype.start = function(){
         var self = this; // reference to this, so we can use it inside our function
         this.automaticStarted = setInterval(function(){
                   var panels = self.getContentPanels(),
                        panelcount = panels.length,
                        current = self.getCurrentPanel(),
                        newpanel;
                   // locate the current panel index, and check if we need to increase or decrease the panel
                   for(var i = 0; i < panelcount; i++){
                        if(panels[i] == current){
                             self.direction == 1 ? (i++) : (i--);
                             self.showPanel( self.direction == 1 ? (i >= panels.length ? 0 : i) : (i < 0 ? panels.length -1 : i));    
                             break; // stop looping, we already found and are displaying our new panel
         }, this.each || 3000);
    Spry.Widget.SlidingPanels.prototype.stop = function(){
         if(this.automaticStarted && typeof this.automaticStarted == 'number'){
              clearInterval(this.automaticStarted);
              this.automaticStarted = null;
    Spry.Widget.SlidingPanels.prototype.setDirection = function(direction){
         this.direction = direction;
    Hopes this helps

  • Images distorted on animation in Spry Sliding Panels

    I have a site here  using a set of sliding panels. It looks okay, but when the panels are animated the image on the left is momentarily stretched right across the panel covering the text, then snapping back into place once the animation stops. It's a bit distracting and I'd like to be able to stop it. Any ideas?
    Tx,
    Michael

    Hi Michael,
    When I look at the CSS for the image
    #praxis_services .SlidingPanelsContent img (line 209)
    padding-top: 0px;
    padding-right: 0px;
    padding-bottom: 0px;
    padding-left: 0px;
    clear: right;
    float: left;
    margin-top: 0px;
    margin-right: 30px;
    margin-bottom: 0px;
    margin-left: 0px;
    position: relative;
    top: 20px;
    it sets the image margins. The margins are set to the whole of the width and height of the sliding panel until the text with a set width is loaded. If you add a div with the required dimensions for the image placing the image inside that div, it should solve your problem. Don't forget to 'float:left'  the new div.
    Hope this helps,
    Ben

  • Problem with Accordion Widget INSIDE Sliding Panel Widget

    Hello,
    perhaps I should not do this, but I nested an Accordion
    Widget inside a Sliding Panels Widget:
    - There are eight Panels.
    - Each one contains a complete Accordion.
    The sliding works fine, and so does the Accordion animation,
    but the text inside the Accordion Panel Tabs won't move along, when
    a tab is activated. I need to hover the mouse over the accordion to
    make the panel texts appear again.
    Of course, when I un-nest the widgets and move the Accordion
    widget out of the Sliding Panel widget, everything is fine.
    My question is:
    - am I demanding "too much" by nesting the widgets?
    - or should this basically work, and the problem arises from
    rivalling scripts?
    Here is a link:
    Nested
    widgets Test
    The horizontal top menu will activate the sliding panels, but
    as of now only the leftmost menu item contains an Accordion (I know
    the CSS does not look nice yet).
    Is there anything I can optimise to get this to work?
    Thank you so much,
    Greetings, Jensen
    Edit: The problem does NOT occur in Firefox, but in
    Safari.

    Hi John,
    That is the expected behavior if the "Overlap items below" is unchecked. Please refer to the following link http://screencasteu.worldsecuresystems.com/aish/2013-08-21_1947.png. If you don't want the page to wiggle up and down, please check the box shown in the screenshot.
    Regards,
    Aish

  • 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();
    }

  • Horizontal Sliding Panels flicker IE

    Hello
    I'm using the horizontal Sliding Panel to slide some Images
    and text. It works fine with Safari on Mac, but with IE and Firefox
    on Windows the animation isn't very smooth (the problem concerns
    only the image, the text-sliding works fine). With the vertical
    Sliding Panels I don't have this problem...
    Can anyone help me? Thanks

    solaris23 wrote:
    > Hello Danilo
    >
    > Horizontal:
    http://www.miomedia.ch/test/SprySlidingPanels.html
    > Vertical:
    http://www.miomedia.ch/test/SprySlidingPanels2.html
    >
    > Look on the image in the horizontal slide, the animation
    flickers on the left
    > and right image-borders.
    > In the vertical slide the animation is much smoother.
    This probably has to do with the rendering of the moved
    elements on the page and IE redrawing portions of the images at a
    time during the slide. I'd suspect that the issue actually exists
    in the vertical slide as well, but is minimized due to the angled
    top and bottom of the images, but that's just a suspicion, not a
    known fact. It seems that if I look closely enough at the animation
    in Firefox it seems to be doing something similar, but it is indeed
    a good bit smoother than IE.
    > I'm using transparent png images, I've also tried with
    jpg, with different
    > duration time, different fps... but still the same
    problem....
    That would have been my suggestion too. A quick local copy of
    your page and it seems that making the duration 1000 milliseconds
    seems to help with moving left to right, but moving right to left
    still has a little bit of flicker.
    I tried making the images smaller and it seemed to be
    lessened, so perhaps it's IE and the larger images rendering. You
    might also try making the vertical lines of the screenshot to be a
    bit less vertical, or perhaps add a shadow or glow to the image to
    soften the hard vertical edge.
    Danilo Celic
    |
    http://blog.extensioneering.com/
    | WebAssist Extensioneer
    | Adobe Community Expert

  • Spry Sliding Panels--how to get it to repeat at the end?

    I have a beautiful working Sliding Panels set up--you can see
    it at:
    http://www.traditional-building.com/index-anim.htm
    (Scroll down to "Browse the Product Gallery")(and no, I did not
    design this attrocious, table-riffic site!). My question is, when I
    get to the last panel, how do I get it to automatically start over
    at the first panel? I can't seem to figure this out...
    thanks!

    Hi Kin,
    ljlindhurst posted this http://forums.adobe.com/message/97681# back in April 2008 without a positive conclusion.  It looks like the same conundrum that I posted a couple of days ago http://forums.adobe.com/thread/851757  :
    “  Spry SlidingPanels
    By default, after the last panel has displayed The Spry slidingPanels Widget causes the panels to zoom backward (visibly) through all the panels to arrive back at the first panel (sp1) to start the cycle again !?
    Well I don't see any sliding panels on line that do that these days, thank goodness, they all transition (continue) from the last to the first panel without a break or “reverse zoom” !    So what am I missing?  “
    Your reply to ljlindhurst started with the following line:
         “Since none of the geniuses have answered your question, I'll give it a try. :-P “
    Well I appreciate your humor and greatly respect all the work you do on the forums, as I suspect many of us do.
    So could you please revisit this item and have a stab at the javascript or code that will make this needed action work.
    Thanks in anticipation.

  • Sliding Panels 'Jumpiness'

    I have a page in development using Spry 1.6.1 hosted
    Here
    The content in the sliding panels is dynamic, and the
    animation 'jumps up' at the end. I've verified that this behavior
    is the same in FF, Safari, IE 7, & Konqueror (OpenSuse 11 KDE4)
    Thanks in advance for your help

    After a nights sleep I poked at this again this morning and
    resolved the issue I was seeing by editing the
    SprySlidingPanels.css as follows:
    comment out
    .SlidingPanelsAnimating * {
    overflow: hidden !important;
    None of my content has scroll bars inside the panel and I was
    trying to reduce the transforms - this seems to have done it

  • Sliding panel horizontal scrollbar problem

    Issue: This is about horizontal sliding panels.
    I want to restrict the height on the sliding panel to say,
    200px. Some of the panel content is longer than that. So I want a
    scrollbar to appear vertically (overflow:auto). It does this.
    However, when the panel with the scrollbar slides off to the left,
    its scrollbar remains present at the leftmost part of the window...
    where the new content panel is.
    Is there any way to prevent this from happening, and allow
    the content that needs the scrollbars to have it?
    thank you

    Hi jratlantic,
    So it appears that you changed the default setting for
    overflow on the .SlidingPanelsContent rule:
    .SlidingPanelsContent {
    width: 547px;
    height: 100px;
    overflow:auto;
    Instead of putting it on the .SlidingPanelsContent, try
    putting it on:
    .SlidingPanelsCurrentPanel {
    overflow:auto;
    And see if that makes a difference. That will ensure that
    only the panel that is currently showing, and not animating, has
    scrollbars.
    --== Kin ==--

  • Problems with Sliding Panels in IE

    I have *finally* gotten my sliding panels script working
    properly. However (and not surprisingly), I am having an issue with
    the addClass and removeClass functions. Although they work properly
    in Firefox, in IE 6 and 7 the add and remove class functions are
    not working properly.
    Any ideas on this?
    Here's the
    example
    Thanks, as always!
    Joel

    Mellymel2000 wrote:
    > Hi There,
    > I'm new to CS3 and can't understand why my animated
    collapsible panels don't
    > work in Internet Explorer. Did I miss some basic notes
    somewhere? Is it just IE
    > 5.2 it doesn't work in? I have created a vertical menu
    bar with them and need
    > to know If it can't be done here does anyone know how
    else I might go about it?
    > Starting to feel a little desperate and any help would
    be welcome.
    > Cheers!
    >
    >
    Is that IE 5.2 on the Mac? If so, don't worry about it, test
    it on IE6
    on a PC instead. The last Mac IE was 5.5 and has not been
    developed in
    about 5 years, its dead, and not a lot works on it nowadays.
    On Mac test
    Safari and Firefox, same on PC but with Opera and IE6 and 7.
    Steve

  • Spry Sliding Panels - current panel height problem

    Hi guys,
    Ive been trying for a while to make the sliding panels widget
    show each panel in its own height instead of the longest panel's height in the container.
    I tried reading all the js file to play with it and find a solution but the truth is i dont know how to do what i want.
    I do, however, have a list of things that i believe if implemented should work,
    could you guys help me do these fixes on the js? ( the one you think will work )
    1. edit so that:  Panels dont have any height ( or panel content display none ) if it isnt current panel. If current panel is "id:1" the assume class 1 style properties. As soon as it looses focus/"currentpanel" class it looses its class 1 properties. And the new current panel ("id:2") assumes its own class 2 properties. And so on.
    2. edit so that:  PanelContainer ( the one that holds all the panels ) displays none BUT the current panel. So all panels could be display none unless they assume the "currentpanel" class and so they change to display. Maybe this way the container assumes only the height of the displayed panel and looses it once its no longer displayed assuming the next displayed one.
    3. edit so that:  Panel container checks for current panel's height and assumes that height instantly ( there is still a panel inside the container that would be longer than the current panel, maybe with overflow hidden this isnt a problem )
    Please, if you can make the change in the js, i would appreciate greatly appreciate it. There is nothing in the entire web in to fixing this.
    This is the SprySlidingPanels.js:
    // SprySlidingPanels.js - version 0.5 - Spry Pre-Release 1.6
    // Copyright (c) 2006. Adobe Systems Incorporated.
    // All rights reserved.
    // Redistribution and use in source and binary forms, with or without
    // modification, are permitted provided that the following conditions are met:
    //   * Redistributions of source code must retain the above copyright notice,
    //     this list of conditions and the following disclaimer.
    //   * Redistributions in binary form must reproduce the above copyright notice,
    //     this list of conditions and the following disclaimer in the documentation
    //     and/or other materials provided with the distribution.
    //   * Neither the name of Adobe Systems Incorporated nor the names of its
    //     contributors may be used to endorse or promote products derived from this
    //     software without specific prior written permission.
    // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
    // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    // POSSIBILITY OF SUCH DAMAGE.
    var Spry;
    if (!Spry) Spry = {};
    if (!Spry.Widget) Spry.Widget = {};
    Spry.Widget.SlidingPanels = function(element, opts)
        this.element = this.getElement(element);
        this.enableAnimation = true;
        this.currentPanel = null;
        this.enableKeyboardNavigation = true;
        this.hasFocus = false;
        this.previousPanelKeyCode = Spry.Widget.SlidingPanels.KEY_LEFT;
        this.nextPanelKeyCode = Spry.Widget.SlidingPanels.KEY_RIGHT;
        this.currentPanelClass = "SlidingPanelsCurrentPanel";
        this.focusedClass = "SlidingPanelsFocused";
        this.animatingClass = "SlidingPanelsAnimating";
        Spry.Widget.SlidingPanels.setOptions(this, opts);
        if (this.element)
            this.element.style.overflow = "hidden";
        // Developers can specify the default panel as an index,
        // id or an actual element node. Make sure to normalize
        // it into an element node because that is what we expect
        // internally.
        if (this.defaultPanel)
            if (typeof this.defaultPanel == "number")
                this.currentPanel = this.getContentPanels()[this.defaultPanel];
            else
                this.currentPanel = this.getElement(this.defaultPanel);
        // If we still don't have a current panel, use the first one!
        if (!this.currentPanel)
            this.currentPanel = this.getContentPanels()[0];
        // Since we rely on the positioning information of the
        // panels, we need to wait for the onload event to fire before
        // we can attempt to show the initial panel. Once the onload
        // fires, we know that all CSS files have loaded. This is
        // especially important for Safari.
        if (Spry.Widget.SlidingPanels.onloadDidFire)
            this.attachBehaviors();
        else
            Spry.Widget.SlidingPanels.loadQueue.push(this);
    Spry.Widget.SlidingPanels.prototype.onFocus = function(e)
        this.hasFocus = true;
        this.addClassName(this.element, this.focusedClass);
        return false;
    Spry.Widget.SlidingPanels.prototype.onBlur = function(e)
        this.hasFocus = false;
        this.removeClassName(this.element, this.focusedClass);
        return false;
    Spry.Widget.SlidingPanels.KEY_LEFT = 37;
    Spry.Widget.SlidingPanels.KEY_UP = 38;
    Spry.Widget.SlidingPanels.KEY_RIGHT = 39;
    Spry.Widget.SlidingPanels.KEY_DOWN = 40;
    Spry.Widget.SlidingPanels.prototype.onKeyDown = function(e)
        var key = e.keyCode;
        if (!this.hasFocus || (key != this.previousPanelKeyCode && key != this.nextPanelKeyCode))
            return true;
        if (key == this.nextPanelKeyCode)
            this.showNextPanel();
        else /* if (key == this.previousPanelKeyCode) */
            this.showPreviousPanel();
        if (e.preventDefault) e.preventDefault();
        else e.returnValue = false;
        if (e.stopPropagation) e.stopPropagation();
        else e.cancelBubble = true;
        return false;
    Spry.Widget.SlidingPanels.prototype.attachBehaviors = function()
        var ele = this.element;
        if (!ele)
            return;
        if (this.enableKeyboardNavigation)
            var focusEle = null;
            var tabIndexAttr = ele.attributes.getNamedItem("tabindex");
            if (tabIndexAttr || ele.nodeName.toLowerCase() == "a")
                focusEle = ele;
            if (focusEle)
                var self = this;
                Spry.Widget.SlidingPanels.addEventListener(focusEle, "focus", function(e) { return self.onFocus(e || window.event); }, false);
                Spry.Widget.SlidingPanels.addEventListener(focusEle, "blur", function(e) { return self.onBlur(e || window.event); }, false);
                Spry.Widget.SlidingPanels.addEventListener(focusEle, "keydown", function(e) { return self.onKeyDown(e || window.event); }, false);
        if (this.currentPanel)
            // Temporarily turn off animation when showing the
            // initial panel.
            var ea = this.enableAnimation;
            this.enableAnimation = false;
            this.showPanel(this.currentPanel);
            this.enableAnimation = ea;
    Spry.Widget.SlidingPanels.prototype.getElement = function(ele)
        if (ele && typeof ele == "string")
            return document.getElementById(ele);
        return ele;
    Spry.Widget.SlidingPanels.prototype.addClassName = function(ele, className)
        if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) != -1))
            return;
        ele.className += (ele.className ? " " : "") + className;
    Spry.Widget.SlidingPanels.prototype.removeClassName = function(ele, className)
        if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) == -1))
            return;
        ele.className = ele.className.replace(new RegExp("\\s*\\b" + className + "\\b", "g"), "");
    Spry.Widget.SlidingPanels.setOptions = function(obj, optionsObj, ignoreUndefinedProps)
        if (!optionsObj)
            return;
        for (var optionName in optionsObj)
            if (ignoreUndefinedProps && optionsObj[optionName] == undefined)
                continue;
            obj[optionName] = optionsObj[optionName];
    Spry.Widget.SlidingPanels.prototype.getElementChildren = function(element)
        var children = [];
        var child = element.firstChild;
        while (child)
            if (child.nodeType == 1 /* Node.ELEMENT_NODE */)
                children.push(child);
            child = child.nextSibling;
        return children;
    Spry.Widget.SlidingPanels.prototype.getCurrentPanel = function()
        return this.currentPanel;
    Spry.Widget.SlidingPanels.prototype.getContentGroup = function()
        return this.getElementChildren(this.element)[0];
    Spry.Widget.SlidingPanels.prototype.getContentPanels = function()
        return this.getElementChildren(this.getContentGroup());
    Spry.Widget.SlidingPanels.prototype.getContentPanelsCount = function()
        return this.getContentPanels().length;
    Spry.Widget.SlidingPanels.onloadDidFire = false;
    Spry.Widget.SlidingPanels.loadQueue = [];
    Spry.Widget.SlidingPanels.addLoadListener = function(handler)
        if (typeof window.addEventListener != 'undefined')
            window.addEventListener('load', handler, false);
        else if (typeof document.addEventListener != 'undefined')
            document.addEventListener('load', handler, false);
        else if (typeof window.attachEvent != 'undefined')
            window.attachEvent('onload', handler);
    Spry.Widget.SlidingPanels.processLoadQueue = function(handler)
        Spry.Widget.SlidingPanels.onloadDidFire = true;
        var q = Spry.Widget.SlidingPanels.loadQueue;
        var qlen = q.length;
        for (var i = 0; i < qlen; i++)
            q[i].attachBehaviors();
    Spry.Widget.SlidingPanels.addLoadListener(Spry.Widget.SlidingPanels.pr ocessLoadQueue);
    Spry.Widget.SlidingPanels.addEventListener = function(element, eventType, handler, capture)
        try
            if (element.addEventListener)
                element.addEventListener(eventType, handler, capture);
            else if (element.attachEvent)
                element.attachEvent("on" + eventType, handler);
        catch (e) {}
    Spry.Widget.SlidingPanels.prototype.getContentPanelIndex = function(ele)
        if (ele)
            ele = this.getElement(ele);
            var panels = this.getContentPanels();
            var numPanels = panels.length;
            for (var i = 0; i < numPanels; i++)
                if (panels[i] == ele)
                    return i;
        return -1;
    Spry.Widget.SlidingPanels.prototype.showPanel = function(elementOrIndex)
        var pIndex = -1;
        if (typeof elementOrIndex == "number")
            pIndex = elementOrIndex;
        else // Must be the element for the content panel.
            pIndex = this.getContentPanelIndex(elementOrIndex);
        var numPanels = this.getContentPanelsCount();
        if (numPanels > 0)
            pIndex = (pIndex >= numPanels) ? numPanels - 1 : pIndex;
        else
            pIndex = 0;
        var panel = this.getContentPanels()[pIndex];
        var contentGroup = this.getContentGroup();
        if (panel && contentGroup)
            if (this.currentPanel)
                this.removeClassName(this.currentPanel, this.currentPanelClass);
            this.currentPanel = panel;
            var nx = -panel.offsetLeft;
            var ny = -panel.offsetTop;
            if (this.enableAnimation)
                if (this.animator)
                    this.animator.stop();
                var cx = contentGroup.offsetLeft;
                var cy = contentGroup.offsetTop;
                if (cx != nx || cy != ny)
                    var self = this;
                    this.addClassName(this.element, this.animatingClass);
                    this.animator = new Spry.Widget.SlidingPanels.PanelAnimator(contentGroup, cx, cy, nx, ny, { duration: this.duration, fps: this.fps, transition: this.transition, finish: function()
                        self.removeClassName(self.element, self.animatingClass);
                        self.addClassName(panel, self.currentPanelClass);
                    this.animator.start();
            else
                contentGroup.style.left = nx + "px";
                contentGroup.style.top = ny + "px";
                this.addClassName(panel, this.currentPanelClass);
        return panel;
    Spry.Widget.SlidingPanels.prototype.showFirstPanel = function()
        return this.showPanel(0);
    Spry.Widget.SlidingPanels.prototype.showLastPanel = function()
        return this.showPanel(this.getContentPanels().length - 1);
    Spry.Widget.SlidingPanels.prototype.showPreviousPanel = function()
        return this.showPanel(this.getContentPanelIndex(this.currentPanel) - 1);
    Spry.Widget.SlidingPanels.prototype.showNextPanel = function()
        return this.showPanel(this.getContentPanelIndex(this.currentPanel) + 1);
    Spry.Widget.SlidingPanels.PanelAnimator = function(ele, curX, curY, dstX, dstY, opts)
        this.element = ele;
        this.curX = curX;
        this.curY = curY;
        this.dstX = dstX;
        this.dstY = dstY;
        this.fps = 60;
        this.duration = 500;
        this.transition = Spry.Widget.SlidingPanels.PanelAnimator.defaultTransition;
        this.startTime = 0;
        this.timerID = 0;
        this.finish = null;
        var self = this;
        this.intervalFunc = function() { self.step(); };
        Spry.Widget.SlidingPanels.setOptions(this, opts, true);
        this.interval = 1000/this.fps;
    Spry.Widget.SlidingPanels.PanelAnimator.defaultTransition = function(time, begin, finish, duration) { time /= duration; return begin + ((2 - time) * time * finish); };
    Spry.Widget.SlidingPanels.PanelAnimator.prototype.start = function()
        this.stop();
        this.startTime = (new Date()).getTime();
        this.timerID = setTimeout(this.intervalFunc, this.interval);
    Spry.Widget.SlidingPanels.PanelAnimator.prototype.stop = function()
        if (this.timerID)
            clearTimeout(this.timerID);
        this.timerID = 0;
    Spry.Widget.SlidingPanels.PanelAnimator.prototype.step = function()
        var elapsedTime = (new Date()).getTime() - this.startTime;
        var done = elapsedTime >= this.duration;
        var x, y;
        if (done)
            x = this.curX = this.dstX;
            y = this.curY = this.dstY;
        else
            x = this.transition(elapsedTime, this.curX, this.dstX - this.curX, this.duration);
            y = this.transition(elapsedTime, this.curY, this.dstY - this.curY, this.duration);
        this.element.style.left = x + "px";
        this.element.style.top = y + "px";
        if (!done)
            this.timerID = setTimeout(this.intervalFunc, this.interval);
        else if (this.finish)
            this.finish();

    Add a valid Document Type Declaration on your page. (DTD) and it should work smoothly.. You could have found this out if you would just validate your page. validator.w3.org.

  • Spry Sliding Panels - Panel Height Problem

    Hi guys,
    Ive been trying for a while to make the sliding panels widget
    show each panel in its own height instead of the longest panel's height in the container.
    I tried reading all the js file to play with it and find a solution but the truth is i dont know how to do what i want.
    I do, however, have a list of things that i believe if implemented should work,
    could you guys help me do these fixes on the js? ( the one you think will work )
    1. edit so that:  Panels dont have any height ( or panel content display none ) if it isnt current panel. If current panel is "id:1" the assume class 1 style properties. As soon as it looses focus/"currentpanel" class it looses its class 1 properties. And the new current panel ("id:2") assumes its own class 2 properties. And so on.
    2. edit so that:  PanelContainer ( the one that holds all the panels ) displays none BUT the current panel. So all panels could be display none unless they assume the "currentpanel" class and so they change to display. Maybe this way the container assumes only the height of the displayed panel and looses it once its no longer displayed assuming the next displayed one.
    3. edit so that:  Panel container checks for current panel's height and assumes that height instantly ( there is still a panel inside the container that would be longer than the current panel, maybe with overflow hidden this isnt a problem )
    Please, if you can make the change in the js, i would appreciate greatly appreciate it. There is nothing in the entire web in to fixing this.
    This is the SprySlidingPanels.js:
    // SprySlidingPanels.js - version 0.5 - Spry Pre-Release 1.6
    // Copyright (c) 2006. Adobe Systems Incorporated.
    // All rights reserved.
    // Redistribution and use in source and binary forms, with or without
    // modification, are permitted provided that the following conditions are met:
    //   * Redistributions of source code must retain the above copyright notice,
    //     this list of conditions and the following disclaimer.
    //   * Redistributions in binary form must reproduce the above copyright notice,
    //     this list of conditions and the following disclaimer in the documentation
    //     and/or other materials provided with the distribution.
    //   * Neither the name of Adobe Systems Incorporated nor the names of its
    //     contributors may be used to endorse or promote products derived from this
    //     software without specific prior written permission.
    // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
    // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    // POSSIBILITY OF SUCH DAMAGE.
    var Spry;
    if (!Spry) Spry = {};
    if (!Spry.Widget) Spry.Widget = {};
    Spry.Widget.SlidingPanels = function(element, opts)
        this.element = this.getElement(element);
        this.enableAnimation = true;
        this.currentPanel = null;
        this.enableKeyboardNavigation = true;
        this.hasFocus = false;
        this.previousPanelKeyCode = Spry.Widget.SlidingPanels.KEY_LEFT;
        this.nextPanelKeyCode = Spry.Widget.SlidingPanels.KEY_RIGHT;
        this.currentPanelClass = "SlidingPanelsCurrentPanel";
        this.focusedClass = "SlidingPanelsFocused";
        this.animatingClass = "SlidingPanelsAnimating";
        Spry.Widget.SlidingPanels.setOptions(this, opts);
        if (this.element)
            this.element.style.overflow = "hidden";
        // Developers can specify the default panel as an index,
        // id or an actual element node. Make sure to normalize
        // it into an element node because that is what we expect
        // internally.
        if (this.defaultPanel)
            if (typeof this.defaultPanel == "number")
                this.currentPanel = this.getContentPanels()[this.defaultPanel];
            else
                this.currentPanel = this.getElement(this.defaultPanel);
        // If we still don't have a current panel, use the first one!
        if (!this.currentPanel)
            this.currentPanel = this.getContentPanels()[0];
        // Since we rely on the positioning information of the
        // panels, we need to wait for the onload event to fire before
        // we can attempt to show the initial panel. Once the onload
        // fires, we know that all CSS files have loaded. This is
        // especially important for Safari.
        if (Spry.Widget.SlidingPanels.onloadDidFire)
            this.attachBehaviors();
        else
            Spry.Widget.SlidingPanels.loadQueue.push(this);
    Spry.Widget.SlidingPanels.prototype.onFocus = function(e)
        this.hasFocus = true;
        this.addClassName(this.element, this.focusedClass);
        return false;
    Spry.Widget.SlidingPanels.prototype.onBlur = function(e)
        this.hasFocus = false;
        this.removeClassName(this.element, this.focusedClass);
        return false;
    Spry.Widget.SlidingPanels.KEY_LEFT = 37;
    Spry.Widget.SlidingPanels.KEY_UP = 38;
    Spry.Widget.SlidingPanels.KEY_RIGHT = 39;
    Spry.Widget.SlidingPanels.KEY_DOWN = 40;
    Spry.Widget.SlidingPanels.prototype.onKeyDown = function(e)
        var key = e.keyCode;
        if (!this.hasFocus || (key != this.previousPanelKeyCode && key != this.nextPanelKeyCode))
            return true;
        if (key == this.nextPanelKeyCode)
            this.showNextPanel();
        else /* if (key == this.previousPanelKeyCode) */
            this.showPreviousPanel();
        if (e.preventDefault) e.preventDefault();
        else e.returnValue = false;
        if (e.stopPropagation) e.stopPropagation();
        else e.cancelBubble = true;
        return false;
    Spry.Widget.SlidingPanels.prototype.attachBehaviors = function()
        var ele = this.element;
        if (!ele)
            return;
        if (this.enableKeyboardNavigation)
            var focusEle = null;
            var tabIndexAttr = ele.attributes.getNamedItem("tabindex");
            if (tabIndexAttr || ele.nodeName.toLowerCase() == "a")
                focusEle = ele;
            if (focusEle)
                var self = this;
                Spry.Widget.SlidingPanels.addEventListener(focusEle, "focus", function(e) { return self.onFocus(e || window.event); }, false);
                Spry.Widget.SlidingPanels.addEventListener(focusEle, "blur", function(e) { return self.onBlur(e || window.event); }, false);
                Spry.Widget.SlidingPanels.addEventListener(focusEle, "keydown", function(e) { return self.onKeyDown(e || window.event); }, false);
        if (this.currentPanel)
            // Temporarily turn off animation when showing the
            // initial panel.
            var ea = this.enableAnimation;
            this.enableAnimation = false;
            this.showPanel(this.currentPanel);
            this.enableAnimation = ea;
    Spry.Widget.SlidingPanels.prototype.getElement = function(ele)
        if (ele && typeof ele == "string")
            return document.getElementById(ele);
        return ele;
    Spry.Widget.SlidingPanels.prototype.addClassName = function(ele, className)
        if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) != -1))
            return;
        ele.className += (ele.className ? " " : "") + className;
    Spry.Widget.SlidingPanels.prototype.removeClassName = function(ele, className)
        if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) == -1))
            return;
        ele.className = ele.className.replace(new RegExp("\\s*\\b" + className + "\\b", "g"), "");
    Spry.Widget.SlidingPanels.setOptions = function(obj, optionsObj, ignoreUndefinedProps)
        if (!optionsObj)
            return;
        for (var optionName in optionsObj)
            if (ignoreUndefinedProps && optionsObj[optionName] == undefined)
                continue;
            obj[optionName] = optionsObj[optionName];
    Spry.Widget.SlidingPanels.prototype.getElementChildren = function(element)
        var children = [];
        var child = element.firstChild;
        while (child)
            if (child.nodeType == 1 /* Node.ELEMENT_NODE */)
                children.push(child);
            child = child.nextSibling;
        return children;
    Spry.Widget.SlidingPanels.prototype.getCurrentPanel = function()
        return this.currentPanel;
    Spry.Widget.SlidingPanels.prototype.getContentGroup = function()
        return this.getElementChildren(this.element)[0];
    Spry.Widget.SlidingPanels.prototype.getContentPanels = function()
        return this.getElementChildren(this.getContentGroup());
    Spry.Widget.SlidingPanels.prototype.getContentPanelsCount = function()
        return this.getContentPanels().length;
    Spry.Widget.SlidingPanels.onloadDidFire = false;
    Spry.Widget.SlidingPanels.loadQueue = [];
    Spry.Widget.SlidingPanels.addLoadListener = function(handler)
        if (typeof window.addEventListener != 'undefined')
            window.addEventListener('load', handler, false);
        else if (typeof document.addEventListener != 'undefined')
            document.addEventListener('load', handler, false);
        else if (typeof window.attachEvent != 'undefined')
            window.attachEvent('onload', handler);
    Spry.Widget.SlidingPanels.processLoadQueue = function(handler)
        Spry.Widget.SlidingPanels.onloadDidFire = true;
        var q = Spry.Widget.SlidingPanels.loadQueue;
        var qlen = q.length;
        for (var i = 0; i < qlen; i++)
            q[i].attachBehaviors();
    Spry.Widget.SlidingPanels.addLoadListener(Spry.Widget.SlidingPanels.pr ocessLoadQueue);
    Spry.Widget.SlidingPanels.addEventListener = function(element, eventType, handler, capture)
        try
            if (element.addEventListener)
                element.addEventListener(eventType, handler, capture);
            else if (element.attachEvent)
                element.attachEvent("on" + eventType, handler);
        catch (e) {}
    Spry.Widget.SlidingPanels.prototype.getContentPanelIndex = function(ele)
        if (ele)
            ele = this.getElement(ele);
            var panels = this.getContentPanels();
            var numPanels = panels.length;
            for (var i = 0; i < numPanels; i++)
                if (panels[i] == ele)
                    return i;
        return -1;
    Spry.Widget.SlidingPanels.prototype.showPanel = function(elementOrIndex)
        var pIndex = -1;
        if (typeof elementOrIndex == "number")
            pIndex = elementOrIndex;
        else // Must be the element for the content panel.
            pIndex = this.getContentPanelIndex(elementOrIndex);
        var numPanels = this.getContentPanelsCount();
        if (numPanels > 0)
            pIndex = (pIndex >= numPanels) ? numPanels - 1 : pIndex;
        else
            pIndex = 0;
        var panel = this.getContentPanels()[pIndex];
        var contentGroup = this.getContentGroup();
        if (panel && contentGroup)
            if (this.currentPanel)
                this.removeClassName(this.currentPanel, this.currentPanelClass);
            this.currentPanel = panel;
            var nx = -panel.offsetLeft;
            var ny = -panel.offsetTop;
            if (this.enableAnimation)
                if (this.animator)
                    this.animator.stop();
                var cx = contentGroup.offsetLeft;
                var cy = contentGroup.offsetTop;
                if (cx != nx || cy != ny)
                    var self = this;
                    this.addClassName(this.element, this.animatingClass);
                    this.animator = new Spry.Widget.SlidingPanels.PanelAnimator(contentGroup, cx, cy, nx, ny, { duration: this.duration, fps: this.fps, transition: this.transition, finish: function()
                        self.removeClassName(self.element, self.animatingClass);
                        self.addClassName(panel, self.currentPanelClass);
                    this.animator.start();
            else
                contentGroup.style.left = nx + "px";
                contentGroup.style.top = ny + "px";
                this.addClassName(panel, this.currentPanelClass);
        return panel;
    Spry.Widget.SlidingPanels.prototype.showFirstPanel = function()
        return this.showPanel(0);
    Spry.Widget.SlidingPanels.prototype.showLastPanel = function()
        return this.showPanel(this.getContentPanels().length - 1);
    Spry.Widget.SlidingPanels.prototype.showPreviousPanel = function()
        return this.showPanel(this.getContentPanelIndex(this.currentPanel) - 1);
    Spry.Widget.SlidingPanels.prototype.showNextPanel = function()
        return this.showPanel(this.getContentPanelIndex(this.currentPanel) + 1);
    Spry.Widget.SlidingPanels.PanelAnimator = function(ele, curX, curY, dstX, dstY, opts)
        this.element = ele;
        this.curX = curX;
        this.curY = curY;
        this.dstX = dstX;
        this.dstY = dstY;
        this.fps = 60;
        this.duration = 500;
        this.transition = Spry.Widget.SlidingPanels.PanelAnimator.defaultTransition;
        this.startTime = 0;
        this.timerID = 0;
        this.finish = null;
        var self = this;
        this.intervalFunc = function() { self.step(); };
        Spry.Widget.SlidingPanels.setOptions(this, opts, true);
        this.interval = 1000/this.fps;
    Spry.Widget.SlidingPanels.PanelAnimator.defaultTransition = function(time, begin, finish, duration) { time /= duration; return begin + ((2 - time) * time * finish); };
    Spry.Widget.SlidingPanels.PanelAnimator.prototype.start = function()
        this.stop();
        this.startTime = (new Date()).getTime();
        this.timerID = setTimeout(this.intervalFunc, this.interval);
    Spry.Widget.SlidingPanels.PanelAnimator.prototype.stop = function()
        if (this.timerID)
            clearTimeout(this.timerID);
        this.timerID = 0;
    Spry.Widget.SlidingPanels.PanelAnimator.prototype.step = function()
        var elapsedTime = (new Date()).getTime() - this.startTime;
        var done = elapsedTime >= this.duration;
        var x, y;
        if (done)
            x = this.curX = this.dstX;
            y = this.curY = this.dstY;
        else
            x = this.transition(elapsedTime, this.curX, this.dstX - this.curX, this.duration);
            y = this.transition(elapsedTime, this.curY, this.dstY - this.curY, this.duration);
        this.element.style.left = x + "px";
        this.element.style.top = y + "px";
        if (!done)
            this.timerID = setTimeout(this.intervalFunc, this.interval);
        else if (this.finish)
            this.finish();

    And on a side note, if it's just IE6 where the problem arises, should I care???
    Have a look here http://www.w3counter.com/globalstats.php
    Gramps

  • Sliding Panels Theme:: Customization??

    Hey all,
    I just got iLife09 and am building a slideshow using the Sliding Panel Theme. It's a great theme but I have a few road blocks that I hope to overcome.
    1. Sometimes the theme chooses a different number of photo slides to show at once. It might be one large pic, all the way up to an arrangement of 5 pics. *Is there anyway that I can choose how many slides are displayed at once?*
    2. If I go to the settings and try to change the minimum seconds a slide will stay on, it says I can't go lower than 3 seconds. If I try to tell an individual slide to stay on for 1 sec, it resets to 3 seconds. The strange thing is, sometimes, it will actually change after 1 second even though the settings say 3 seconds. I have to keep trying to tweak the settings to get it to do what I want, but the settings always say 3 seconds.
    I hope that last one makes sense.
    Thanks

    No, you can't customize the theme. ☹ You'll have to make do with the standard for just one slide at a time or try a 3rd party slideshow application like PhotoPresenter which has over 25 animated themes. This demo page has examples of a number of them: PhotoPresenter Animated Slideshow Themes.
    OT

  • Is it possible to get one sliding panel to automatically display a web site?

    I have a slinding panel widget with 6 content panes.  One of the tabs is named "Online Help'.  I would like the content pane for that tab to automattically display a form that is on a website.
    The 'onclick' that is associated with the "Online Help" tab is calling the sliding panel number.  If I repace it with an http address, the other panels continue to display but, that panel displays blank.
    I have tried a CSS style tag for the panel that includes the http url in a background attribute.  That is not working either.
    I made a stab at spry:detailregion, but I don't know if a url can be a prameter in that element.
    Does anyone have ideas on what I can try?
    Thanks,
    meileendougherty

    Well, a url can be the contents of a data cell, but it will only give you a link, not the other website.
    Although iframes are often considered tricky, I have not had bad luck with them. Put an iframe in your content cell, and use your other website as the source. You will have to give the iframe dimensions, or it will default to 'pretty small'.
    Beth

Maybe you are looking for