Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vertical and horizontal orientation in slideshow - how to get both?

Status
Not open for further replies.

tcortez

Technical User
Jul 12, 2000
3
US
I am new to javascript.&nbsp;&nbsp;I have managed to get a slideshow together but I my horizontal slides appear distorted in a vertical format.&nbsp;&nbsp;There is a vertical image in place before the slideshow begins so I'm assuming it's orientation becomes the norm.&nbsp;&nbsp;At one point, I removed the hieght and width attributes from the initial static image and it worked!&nbsp;&nbsp;But I'm using FrontPage 2000 which inserted the height and width back in on it's own and even if I delete them again it doesn't work anymore.&nbsp;&nbsp;I also cannot get rid of the grey band under the image?!&nbsp;&nbsp;The slideshow is at <br><A HREF=" TARGET="_new"> the Before and the Demolition texts will start a slide show.&nbsp;&nbsp;My code for the page follows below.<br>Thank you in advance to any suggestion one might offer me!<br>Tracy<br><br>&lt;html&gt;<br><br>&lt;head&gt;<br><br>&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=windows-1252&quot;&gt;<br>&lt;meta name=&quot;GENERATOR&quot; content=&quot;Microsoft FrontPage 4.0&quot;&gt;<br>&lt;meta name=&quot;ProgId&quot; content=&quot;FrontPage.Editor.Document&quot;&gt;<br><br>&lt;title&gt;RAC Design ¦ Build&lt;/title&gt;<br><br>&lt;SCRIPT LANGUAGE=&quot;JavaScript&quot;&gt;<br>&lt;!-- Beginning of JavaScript - Slideshow<br>&nbsp;&nbsp;<br>if (document.images) {<br><br> bef = new Array()<br> <br> bef[1] = new Image(280, 210);<br> bef[1].src = &quot;images/blackman/backclip.jpg&quot;;<br><br> bef[2] = new Image(280, 210);<br> bef[2].src = &quot;images/blackman/before/ext1.jpg&quot;;<br> <br> bef[3] = new Image(210, 280);<br> bef[3].src = &quot;images/blackman/before/ext2.jpg&quot;;<br> <br> bef[4] = new Image(210, 280);<br> bef[4].src = &quot;images/blackman/before/ext3.jpg&quot;;<br><br> bef[5] = new Image(210, 280);<br> bef[5].src = &quot;images/blackman/before/ext4.jpg&quot;;<br><br> bef[6] = new Image(210, 280);<br> bef[6].src = &quot;images/blackman/before/ext5.jpg&quot;;<br> <br> bef[7] = new Image(210, 280);<br> bef[7].src = &quot;images/blackman/before/int1.jpg&quot;;<br><br> bef[8] = new Image(210, 280);<br> bef[8].src = &quot;images/blackman/before/int2.jpg&quot;;<br><br> bef[9] = new Image(280, 210);<br> bef[9].src = &quot;images/blackman/backclip.jpg&quot;;<br>}<br><br>var timer = null<br>var counter = 1<br><br>function slideshowBefore() {<br> timer=setTimeout(&quot;slideshowBefore()&quot;, 2000);<br> counter++;<br> if (counter &gt;= 10) <br> endtimerBefore();<br> document.pics.src = bef[counter].src;<br>}<br><br>function endtimerBefore() {<br> <br> document.pics.src = bef[8].src;<br> clearTimeout(timer);<br> counter = 1;<br>}<br><br>if (document.images) {<br><br> dem = new Array()<br> <br> dem[1] = new Image(280, 210);<br> dem[1].src = &quot;images/blackman/backclip.jpg&quot;;<br><br> dem[2] = new Image(210, 280);<br> dem[2].src = &quot;images/blackman/demo/demo1.jpg&quot;;<br> <br> dem[3] = new Image(210, 280);<br> dem[3].src = &quot;images/blackman/demo/demo2.jpg&quot;;<br> <br> dem[4] = new Image(210, 280);<br> dem[4].src = &quot;images/blackman/demo/demo3.jpg&quot;;<br><br> dem[5] = new Image(210, 280);<br> dem[5].src = &quot;images/blackman/demo/demo4.jpg&quot;;<br><br> dem[6] = new Image(210, 280);<br> dem[6].src = &quot;images/blackman/demo/demo5.jpg&quot;;<br> <br> dem[7] = new Image(280, 210);<br> dem[7].src = &quot;images/blackman/demo/demo6.jpg&quot;;<br><br> dem[8] = new Image(280, 210);<br> dem[8].src = &quot;images/blackman/demo/demo7.jpg&quot;;<br><br> dem[9] = new Image(280, 210);<br> dem[9].src = &quot;images/blackman/backclip.jpg&quot;;<br>}<br><br>var timer = null<br>var counter = 1<br><br>function slideshowDemo() {<br> timer=setTimeout(&quot;slideshowDemo()&quot;, 2000);<br> counter++;<br> if (counter &gt;= 10) <br> endtimerDemo();<br> document.pics.src = dem[counter].src;<br>}<br><br>function endtimerDemo() {<br> <br> document.pics.src = dem[8].src;<br> clearTimeout(timer);<br> counter = 1;<br>}<br><br>// - End of JavaScript - Slideshow --&gt;<br>&lt;/SCRIPT&gt;<br><br><br>&lt;/head&gt;<br><br>&lt;BODY BGCOLOR=&quot;#999966&quot;&gt;<br>&lt;DIV ALIGN=&quot;center&quot;&gt;<br><br>&lt;TABLE BGCOLOR=&quot;999966&quot; WIDTH=&quot;685&quot; HEIGHT=&quot;494&quot; BORDER=&quot;0&quot; CELLSPACING=&quot;0&quot; CELLPADDING=&quot;0&quot;&gt;<br><br>&lt;!--[1_Horiz_top_border_outer_table]--&gt; <br> &lt;TR&gt;<br> &lt;TD BGCOLOR=&quot;#ffffcc&quot; COLSPAN=&quot;5&quot; WIDTH=&quot;685&quot; HEIGHT=&quot;1&quot;&gt;<br> &lt;img src=&quot;images/1x1spacer.gif&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot;&gt;&lt;/TD&gt;<br> &lt;/TR&gt;<br>&lt;!--[/1_Horiz_top_border_outer_table]--&gt;<br> <br>&lt;!--[2_Vert_left_border_outer_table]--&gt; <br> &lt;TR&gt;<br> &lt;TD BGCOLOR=&quot;#ffffcc&quot; ROWSPAN=&quot;3&quot; WIDTH=&quot;1&quot; HEIGHT=&quot;492&quot;&gt;<br> &lt;img src=&quot;images/1x1spacer.gif&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot;&gt;&lt;/TD&gt;<br>&lt;!--[/2_Vert_left_border_outer_table]--&gt;<br>&lt;!--[3_MENU_TOP]--&gt; <br> &lt;TD BGCOLOR=&quot;#999966&quot; COLSPAN=&quot;3&quot; ALIGN=&quot;LEFT&quot; VALIGN=&quot;top&quot; WIDTH=&quot;683&quot; HEIGHT=&quot;60&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;img border=&quot;0&quot; src=&quot;images/mainMenuWp.gif&quot; width=&quot;683&quot; height=&quot;60&quot;&gt;&lt;/TD&gt;<br>&lt;!--[/3-MENU_TOP]--&gt;<br>&lt;!--[4-Vert_right_border_outer_table]--&gt;<br> &lt;TD BGCOLOR=&quot;#ffffcc&quot; ROWSPAN=&quot;3&quot; WIDTH=&quot;1&quot; HEIGHT=&quot;492&quot;&gt;<br> &lt;img src=&quot;images/1x1spacer.gif&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot;&gt;&lt;/TD&gt;<br> &lt;/TR&gt;<br>&lt;!--[/4-Vert_right_border_outer_table]--&gt;<br><br>&lt;!--[5_MENU_LEFT]--&gt;<br> &lt;TR&gt;<br> &lt;TD BGCOLOR=&quot;#999966&quot; ALIGN=&quot;LEFT&quot; VALIGN=&quot;top&quot; WIDTH=&quot;175&quot; HEIGHT=&quot;412&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TD&gt;<br>&lt;!--[/5_MENU_LEFT]--&gt;<br><br>&lt;!--[6_Cell_Containing_Inner_Table]--&gt;<br> &lt;TD WIDTH=&quot;468&quot; HEIGHT=&quot;412&quot;&gt;<br> &lt;TABLE WIDTH=&quot;468&quot; HEIGHT=&quot;412&quot; BORDER=&quot;0&quot; CELLSPACING=&quot;0&quot; CELLPADDING=&quot;0&quot;&gt;<br> <br> &lt;!--[A)_Horiz_top_border_inner_table]--&gt; <br> &lt;TR&gt;<br> &lt;TD BGCOLOR=&quot;FFFFCC&quot; WIDTH=&quot;468&quot; HEIGHT=&quot;1&quot; COLSPAN=&quot;3&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;img src=&quot;images/1x1spacer.gif&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot;&gt;&lt;/TD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TR&gt;<br> &lt;!--[/A)_Horiz_top_border_inner_table]--&gt;<br> <br> &lt;!--[B)_Vert_left_border_inner_table]--&gt;<br> &lt;TR&gt;<br> &lt;TD BGCOLOR=&quot;FFFFCC&quot; WIDTH=&quot;1&quot; HEIGHT=&quot;410&quot; ROWSPAN=&quot;5&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;img src=&quot;images/1x1spacer.gif&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot;&gt;&lt;/TD&gt; <br> &lt;!--[/B)_Vert_left_border_inner_table]--&gt;<br> &lt;!--[C)_Horiz_menu_cell_inner_table]--&gt;<br> &lt;TD BGCOLOR=&quot;660000&quot; ALIGN=&quot;left&quot; WIDTH=&quot;466&quot; HEIGHT=&quot;20&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;a href=&quot;Javascript:void(slideshowBefore())&quot;&gt;&lt;img alt=&quot;before&quot; border=&quot;0&quot; src=&quot;images/blackman/before_off.gif&quot; width=&quot;50&quot; height=&quot;20&quot;&gt;&lt;/a&gt;<br> &lt;a href=&quot;Javascript:void(slideshowDemo())&quot;&gt;&lt;img alt=&quot;demo&quot; border=&quot;0&quot; src=&quot;images/blackman/demo.gif&quot; width=&quot;70&quot; height=&quot;20&quot;&gt;&lt;/a&gt;<br> &lt;img border=&quot;0&quot; src=&quot;images/blackman/concrete.gif&quot; width=&quot;65&quot; height=&quot;20&quot;&gt;<br> &lt;img border=&quot;0&quot; src=&quot;images/blackman/framing.gif&quot; width=&quot;58&quot; height=&quot;20&quot;&gt;<br> &lt;img border=&quot;0&quot; src=&quot;images/blackman/windows.gif&quot; width=&quot;62&quot; height=&quot;20&quot;&gt;<br> &lt;img border=&quot;0&quot; src=&quot;images/blackman/crew.gif&quot; width=&quot;32&quot; height=&quot;20&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TD&gt;<br> &lt;!--[/C)_Horiz_menu_cell_inner_table]--&gt;<br> &lt;!--[D)_Vert_right_border_inner_table]--&gt;<br> &lt;TD BGCOLOR=&quot;FFFFCC&quot; WIDTH=&quot;1&quot; HEIGHT=&quot;410&quot; ROWSPAN=&quot;5&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;img src=&quot;images/1x1spacer.gif&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot;&gt;&lt;/TD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TR&gt;<br> &lt;!--[/D)_Vert_right_border_inner_table]--&gt; <br> <br> &lt;!--[E)_Horiz_top_cell_inner_table]--&gt;<br> &lt;TR&gt;<br> &lt;TD BGCOLOR=&quot;#333333&quot; ALIGN=&quot;center&quot; WIDTH=&quot;466&quot; HEIGHT=&quot;10&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;img border=&quot;0&quot; src=&quot;images/blackman/back1.gif&quot; width=&quot;466&quot; height=&quot;10&quot;&gt;&lt;/TD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TR&gt;<br> &lt;!--[/E)_Horiz_top_cell_inner_table]--&gt; <br> <br> &lt;!--[F)_Horiz_image_cell_inner_table]--&gt;<br> &lt;TR&gt;<br> &lt;TD BGCOLOR=&quot;#333333&quot; Background=&quot;images/blackman/back2.gif&quot; ALIGN=&quot;center&quot; WIDTH=&quot;466&quot; HEIGHT=&quot;280&quot; NAME=&quot;slides&quot;&gt;<br> &lt;img border=&quot;0&quot; src=&quot;images/blackman/backclip.jpg&quot; NAME=&quot;pics&quot;&gt;<br> &lt;/TD&gt;<br> &lt;/TR&gt;<br> &lt;!--[/F)_Horiz_image_cell_inner_table]--&gt;<br> <br> &lt;!--[G)_Horiz_navigate_cell_inner_table]--&gt;<br> &lt;TR&gt;<br> &lt;TD BGCOLOR=&quot;#333333&quot; ALIGN=&quot;center&quot; WIDTH=&quot;466&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;img border=&quot;0&quot; src=&quot;images/blackman/back3.gif&quot; width=&quot;466&quot; height=&quot;20&quot;&gt;&lt;/TD&gt;<br> &lt;/TR&gt;<br> &lt;!--[/G)_Horiz_navigate_cell_inner_table]--&gt;<br> <br> &lt;!--[H)_Horiz_description_cell_inner_table]--&gt;<br> &lt;TR&gt;<br> &lt;TD BGCOLOR=&quot;#333333&quot; ALIGN=&quot;center&quot; WIDTH=&quot;466&quot; HEIGHT=&quot;80&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;img border=&quot;0&quot; src=&quot;images/blackman/back4.gif&quot; width=&quot;466&quot; height=&quot;80&quot;&gt;&lt;/TD&gt;<br> &lt;/TR&gt;<br> &lt;!--[/H)_Horiz_description_cell_inner_table]--&gt;<br> <br> &lt;!--[I)_Horiz_bottom_border_inner_table]--&gt; <br> &lt;TR&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;TD BGCOLOR=&quot;FFFFCC&quot; WIDTH=&quot;468&quot; HEIGHT=&quot;1&quot; COLSPAN=&quot;3&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;img src=&quot;images/1x1spacer.gif&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot;&gt;&lt;/TD&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/TR&gt;<br> &lt;!--[/I)_Horiz_bottom_border_inner_table]--&gt;<br> &lt;/TABLE&gt;<br> &lt;/TD&gt;<br>&lt;!--[/6_Cell_Containing_Inner_Table]--&gt;<br><br>&lt;!--[7_Vert_space_at_right_outer_table]--&gt;<br> &lt;TD BGCOLOR=&quot;999966&quot; WIDTH=&quot;40&quot; HEIGHT=&quot;412&quot;&gt;&lt;/TD&gt;<br> &lt;/TR&gt;<br>&lt;!--[/7_Vert_space_at_right_outer_table]--&gt;<br><br>&lt;!--[8_Horiz_space_at_bottom_outer_table]--&gt;<br> &lt;TR&gt;<br> &lt;TD BGCOLOR=&quot;999966&quot; COLSPAN=&quot;3&quot; WIDTH=&quot;683&quot; HEIGHT=&quot;20&quot;&gt; &lt;/TD&gt;<br> &lt;/TR&gt;<br>&lt;!--[/8_Horiz_space_at_bottom_outer_table]--&gt;<br><br>&lt;!--[9_Horiz_bottom_border_outer_table]--&gt;<br> &lt;TR&gt;<br> &lt;TD BGCOLOR=&quot;FFFFCC&quot; COLSPAN=&quot;5&quot; WIDTH=&quot;685&quot; HEIGHT=&quot;1&quot;&gt;<br> &lt;img src=&quot;images/1x1spacer.gif&quot; width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot;&gt;&lt;/TD&gt;<br> &lt;/TR&gt;<br>&lt;!--[/9_Horiz_bottom_border_outer_table]--&gt;<br><br>&lt;/table&gt;<br>&lt;/body&gt;<br>
 
First things first, trash Frontpage 2000, and buy HomeSite and Dreamweaver (or even just Homesite - it goes for about 100 bucks I think).<br><br>Secondly, pardon me, but I dont quite understand what you mean by vertical or horizontal orientation. Please explain...<br><br><A HREF="mailto:jared@aauser.com">jared@aauser.com</A>
 
Hi jared,&nbsp;&nbsp;I thought someone might say that!&nbsp;&nbsp;I'll definitely take that into consideration.&nbsp;&nbsp;What I mean be vertical and horizontal orientation:<br>I have jpegs from my digital camera.&nbsp;&nbsp;Some were taken in the portrait or vertical orientation and some were taken in landscape or horizontal orientation.&nbsp;&nbsp;The vertical images are 280 tall x 210 wide, the horizontal images are 210 tall x 280 wide.&nbsp;&nbsp;You'll notice on my website that all images are showing up vertical 280 tall x 210 wide.&nbsp;&nbsp;You can tell which are supposed to be horizontal from my code or from the images themselves.&nbsp;&nbsp;The ones that are supposed to be horizontal are distorted with jagged edges.
 
tcortez,<br><br>Try this:<br><br>document.pics.width = nCorrectWidth;<br>document.pics.height = nCorrectHeight;<br><br>I've never done that so I don't know if it works. <br><br>If not you will need to provide separate image tags for each different height/width combination you have. Then control their visibility when you switch images into the img elements in the different layers.<br><br>Good luck<br>-pete<br><br>
 
If youre experiencing the problem in Netscape, it's because it cannot reflow a document, so an image replacement must be the same as the original, or else it will stretch or clip it to fit...<br><br><br><A HREF="mailto:jared@aauser.com">jared@aauser.com</A>
 
You said that it worked if you remove the imags's width, and height tags (untill frontpage screwed with it). Well, a slideshow with different images will only work if the browser is ie 5.0, and no width, or height attributes are used in the original image.<br><br>We've all tried to do that, and for the most part failed.<br>Yet another flaw of netscape.<br> <p>theEclipse<br><a href=mailto:eclipse_web@hotmail.com>eclipse_web@hotmail.com</a><br><a href=robacarp.webjump.com>robacarp.webjump.com</a><br>**-Trying to build a documentation of a Javascript DOM, crossbrowser, of course. E-mail me if you know of any little known events and/or methods, etc.
 
Thank you to everyone who commented.&nbsp;&nbsp;It helps to know when something you are trying to do can't be done or not easily at least.&nbsp;&nbsp;Jared, it doesn't work in IE 5.0 as well as Netscape.&nbsp;&nbsp;But since you let me know Netscape can't do it and theEclipse let me know that I could marginally pull it off but only in IE 5, I think it's time to try something simpler that will work on both platforms.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top