Link to home
Start Free TrialLog in
Avatar of ddantes
ddantesFlag for United States of America

asked on

Disappearing slide show

I have a slide show at www.mauitradewinds.com/Cycle/vanishing.htm    It is supposed to resize with the browser window.  Sometimes it does that, but much of the time is just vanishes when the window is resized.  Can this be fixed?
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

I may be that the slide show requires minimum dimension and falls out when the window is resize less than that.  you could try setting min-width on the body of the page and see if that solves it.
Avatar of ddantes

ASKER

Thank you for your comment.  Could you please provide a code snippet which I can insert on my page?  And please let me know where to insert that.
in the styleheet:

body {min-width:600px}

or you can do it right in the body tag:

<body style="min-width:600px">

The second method is not good practice.
Avatar of ddantes

ASKER

Thank you for that specification.  In a stylesheet which is linked to the page I added:

#body {min-width:600px;}

but the slide show still vanishes when the window is resized.  I tried the css code with and without a ";"  and also inserted that code within a style portion of the page itself.
ASKER CERTIFIED SOLUTION
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ddantes

ASKER

Thank you for your comment.  However, I'm using the same code to resize the slide show at www.mauitradewinds.com/Cycle  and it does not disappear when the window is resized.  The problem developed when I tried to use a %width as a starting point for the slide show, instead of a fixed pixel width.  For that reason, I thought it was a styling issue.  Can you advise me how to substitute a % width instead of a fixed pixel width without making the show disappear?
I would not use a percentage directly.  In the resize function I would calculate as a fraction of the body width and apply it in pixels to the slideshow. I'm not sure what you are getting with the calculations you are doing there now.  If I want something; say 60% I  just do:

document.getElementById('someid').style.width=(parseInt(document.body.offsetWidth *.6)) + "px";

That retains the relationship with the body, but expresses the style in pixels.  So if the problem is going from pixels to percentage, this might be a way around the problem.
Avatar of ddantes

ASKER

Thank you.  I would like to test that approach.  Would you mind showing me where it belongs in the code for my page?
It needs to be in the resize function.  I'm not clear what the Jscript is doing there, but it looks like some kind of adjustment to the dimensions.  As I said before, I am not a Jscript expert so I am not sure of how to express the calculation in Jscript.