Results 1 to 7 of 7

Thread: Conveyor Belt Slideshow

  1. #1
    Join Date
    Jan 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Conveyor Belt Slideshow

    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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,028
    Thanks
    44
    Thanked 3,210 Times in 3,172 Posts
    Blog Entries
    12

    Default

    It means use HTML. Like:
    HTML Code:
    <table style=border-collapse:collapse;border:0><tr><td width=2px>&nbsp;</td></tr></table>
    or:
    HTML Code:
    <img src=spacer.gif width=2px height=1px>
    that one requires spacer.gif which can be transparent or any color you like. Or:
    HTML Code:
    <span>~</span>

  3. #3
    Join Date
    Jan 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Didn't work for me

    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

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,028
    Thanks
    44
    Thanked 3,210 Times in 3,172 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by link
    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:
    Quote Originally Posted by jscheuer1
    <img src=spacer.gif width=2px height=1px>
    Notice the difference? You can use your method but, escape the double quotes:
    Code:
    var imagegap="<img src=\"pxl_clear.gif\" width=\"2\" height=\"1\">"
    like that. This should work too:
    Code:
    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.
    Last edited by jscheuer1; 04-06-2005 at 04:37 PM.

  5. #5
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1
    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:
    Code:
    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

    Code:
    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

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,028
    Thanks
    44
    Thanked 3,210 Times in 3,172 Posts
    Blog Entries
    12

    Default

    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.

  7. #7
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1
    Why must units be omitted?
    As I said, they're prespecified. Consider:

    Code:
    <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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •