PDA

View Full Version : Conveyor Belt Slideshow



link
04-06-2005, 03:07 AM
The Conveyor Belt Slideshow is great ... and I thank you.

//Specify gap between each image (use HTML):
var imagegap=" "

When I put a "2" there, the 2 is visible. What does it mean by 'use HTML' for the pixel number?

Thanks,
LinK

jscheuer1
04-06-2005, 04:00 AM
It means use HTML. Like:
<table style=border-collapse:collapse;border:0><tr><td width=2px>&nbsp;</td></tr></table>or:

<img src=spacer.gif width=2px height=1px>that one requires spacer.gif which can be transparent or any color you like. Or:
<span>~</span>

link
04-06-2005, 03:25 PM
Thanks for your help. I tried the image like this (below)
//Specify gap between each image (use HTML):
var imagegap="<img src="pxl_clear.gif" width="2" height="1">"

With a spacer image pxl_clear.gif in my main directory
and then the slideshow didn't appear at all!

So I tried:
var imagegap="<span>2</span>" and the '2' shows between the pictures.

Removing the " " removes the slideshow too.

Thanks,
LinK

jscheuer1
04-06-2005, 04:35 PM
var imagegap="<img src="pxl_clear.gif" width="2" height="1">"This won't work because you have unescaped double quotes (") in it. I said to do it like:
<img src=spacer.gif width=2px height=1px>Notice the difference? You can use your method but, escape the double quotes:
var imagegap="<img src=\"pxl_clear.gif\" width=\"2\" height=\"1\">"like that. This should work too:
var imagegap='<img src="pxl_clear.gif" width="2" height="1">'Here I just changed the string delimiters to single quotes ('). Also, depending upon your !DOCTYPE, if any, you may need to use the px designation for the dimensions.

mwinter
04-06-2005, 06:00 PM
I said to do it like:


<img src=spacer.gif width=2px height=1px>Notice the difference?However, the units must be omitted, and it would be better to include some form of quotation, especially should the introduction of path information become necessary.


This should work too:
var imagegap='<img src="pxl_clear.gif" width="2" height="1">'Here I just changed the string delimiters to single quotes (').It's also acceptable to use single quotes for attribute values, so


var imagegap = "<img src='pxl_clear.gif' width='2' height='1'>";is also fine. However, spacer images are horrible hacks and should be avoided. It would be better to style the necessary padding.


Also, depending upon your !DOCTYPE, if any, you may need to use the px designation for the dimensions.Units are only necessary in CSS declarations. In that situation, units must always be specified, irrespective of DOCTYPE (or lack thereof). In HTML attributes, length values are always pixels or percentages. The latter is indicated with a percentage symbol (%). Multilength values (used by the cols and rows attributes of the frameset element, and the width attribute of the col and colgroup elements) also allows relative lengths, indicated with an asterisk (*).

Mike

jscheuer1
04-06-2005, 08:52 PM
Mike, Mike, Mike, mmmmm Why must units be omitted? It is valid HTML. I think this falls into the category of risking confusing the OP.

To Link:

Although what Mike (mwinter) says is probably technically correct, if it is over your head you can safely ignore all of it except the part about not using px. That may or may not cause a problem. I doubt that it will but, if Mike says it will, it might. I don't want to take the time to test it just now.

mwinter
04-06-2005, 09:30 PM
Why must units be omitted?As I said, they're prespecified. Consider:


<table width="40em">
<tr>
<td>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam
consectetuer massa eu lectus eleifend malesuada. Etiam rutrum arcu sed justo
mattis porttitor. Pellentesque tempus, diam et ornare ornare, massa arcu
adipiscing sem, vitae porttitor wisi quam sed lacus. Integer in eros. Ut in
arcu at nunc volutpat interdum. Sed ornare egestas wisi. Nullam vestibulum
lorem eget dui. Vestibulum ante ipsum primis in faucibus orci luctus et
ultrices posuere cubilia Curae; Nam luctus enim nec purus. Aliquam blandit
aliquam magna. Integer varius nulla sit amet elit. Aliquam dignissim odio vel
dui. Donec tortor sapien, venenatis ut, auctor et, mattis sed, augue.</td>
</tr>
</table>If units were respected, the text would span about 60% of the width of Firefox using my settings. However, Firefox ignores it completely and spans the entire width. IE and Opera ignore the unit specifier and treats the number as a pixel value, so the text is compressed into the left-hand edge.


It is valid HTML.No, it isn't.


I think this falls into the category of risking confusing the OP.Perhaps, so I'll make it clear:

If you use a HTML attribute, such as width, to set the dimensions of an element, no unit values are necessary. If the value is a number, it will always be assumed to be in pixels.

If you use a CSS property, either in a style sheet or a style attribute, you must always specify a unit.

Mike