image alt

Discussion in 'HTML' started by Stijn Goris, Mar 4, 2004.

  1. Stijn Goris

    Stijn Goris Guest

    hi all,

    Is it possible to show an image using 'alt'? Maybee via javascript?

    kind regards
    Stijn
     
    Stijn Goris, Mar 4, 2004
    #1
    1. Advertising

  2. Stijn Goris

    Dylan Parry Guest

    Stijn Goris wrote:

    > hi all,
    >
    > Is it possible to show an image using 'alt'? Maybee via javascript?


    Erm, the "alt" means "alternative" as in a replacement for the image when
    images cannot be shown - so what would be the point in showing an image in
    replacement if you cannot see that one either??

    --
    Dylan Parry
    http://www.webpageworkshop.co.uk - FREE Web tutorials and references
    Now playing: Sky - Danza
     
    Dylan Parry, Mar 4, 2004
    #2
    1. Advertising

  3. "Stijn Goris" <> wrote:

    > Is it possible to show an image using 'alt'?


    What do you mean by showing an image and by using 'alt'?

    > Maybee via javascript?


    The point being exactly what?

    In an <img> tag, the src attribute specifies the image, while the alt
    attribute specifies the textual alternative. What is your problem with
    that? (I wonder if the next question is how to show the textual
    alternative using 'src'. :))

    OK, guessing what you _might_ mean: if foo.png is not available or
    cannot be rendered, could we specify something in <img src="foo.png"
    ....> to tell the browser use bar.img instead?

    In practice, no. In theory, you could use
    <object data="foo.png" width="..." height="...">
    <img src="bar.gif" alt="...">
    </object>
    but you will probably be disappointed - browsers have implemented the
    <object> element very poorly. When foo.png is not available, e.g. IE 6
    shows just an empty box.

    (It is possible to do content negotiation on the image format, e.g.
    send a PNG image to browsers that express their ability to deal with
    that and a GIF image to others. But this is a server-side issue and,
    besides, browsers generally lie about their capabilities.)

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
     
    Jukka K. Korpela, Mar 4, 2004
    #3
  4. Stijn Goris

    Stijn Goris Guest

    "Stijn Goris" <> wrote in message
    news:SJJ1c.22869$-ops.be...
    > hi all,
    >
    > Is it possible to show an image using 'alt'? Maybee via javascript?
    >
    > kind regards
    > Stijn
    >


    I indeed know what the alt stands for but.. I have a page without the room
    to show all the images I want. Therefore I show the filename and want to
    create some image next to each filename that when the user floats above that
    picture that the actual file shows up.

    Maybee via another priciple this can be done also....


    kind regards
    Stijn
     
    Stijn Goris, Mar 4, 2004
    #4
  5. Stijn Goris

    Steve R. Guest

    Stijn Goris wrote in message...
    > I have a page without the room
    > to show all the images I want.


    So why not use thumbnail image links then?

    They are much the best way, and people only look at images they request.
     
    Steve R., Mar 4, 2004
    #5
  6. Stijn Goris

    Stijn Goris Guest

    "Steve R." <stevie_ritchie(NOSPAM)@hotmail.com> wrote in message
    news:HQK1c.8586$...
    > Stijn Goris wrote in message...
    > > I have a page without the room
    > > to show all the images I want.

    >
    > So why not use thumbnail image links then?
    >
    > They are much the best way, and people only look at images they request.
    >
    >


    Is are thmbnails

    It can be a gigantic list of images a user can delete. I want to avoid that
    the user fisrt has to click a link to see the thumb. Floating above a link
    will be better...
     
    Stijn Goris, Mar 4, 2004
    #6
  7. Stijn Goris

    GD Guest

    Stijn Goris <> wrote:
    > I have a page without the room to show all the images I want.
    > Therefore I show the filename and want to create some image next to
    > each filename that when the user floats above that picture that the
    > actual file shows up.


    You could have a list of links to each image and then use a Javascript
    image-swap to take the link text (if it's the file name) or HREF and use
    it as the SRC of an image. If you position the image you can use
    Javascript to make the image jump to each link you hover over.

    In the HTML have something like:

    <body>
    <div id="show">
    <img src="/images/default.gif"
    alt="Select a link to view the image" title="">
    </div>
    <ol id="list">
    <li><a href="/images/apple.gif">apple.gif</a></li>
    <li><a href="/images/banana.gif">banana.gif</a></li>
    <li><a href="/images/orange.gif">orange.gif</a></li>
    </ol>
    </body>



    IN THE JAVASCRIPT:

    onload=function() {
    show=document.getElementById('show')
    show.img=show.getElementsByTagName('img')[0]
    list=document.getElementById('list').getElementsByTagName('a')
    for(i=0; i<list.length; i++) list.onmouseover=imgShow
    }

    function imgShow() {
    show.img.src=this.href
    item=this
    topDistance=0
    do topDistance+=item.offsetTop
    while(item=item.parentNode)
    show.style.top=topDistance.toString()+'px'
    }



    AND IN THE CSS:

    body {
    padding:0;
    margin:0;
    }

    #list {
    margin:1em 65% 1em 5%;
    }

    #show {
    position:absolute;
    top:0;
    left:30%;
    width:70%;
    }

    In IE5, Opera 7 and Mozilla, each new image should display at its
    original size. If you want to display them all at the same size then
    specify a width/height for the image.


    > Maybee via another priciple this can be done also....


    You could use absolute positioning and CSS rollover effects to load all
    images but show just one at a time but only Opera and Mozilla have
    enough CSS support for that to work.
     
    GD, Mar 4, 2004
    #7
  8. Stijn Goris

    Steve R. Guest

    Stijn Goris wrote in message ...
    > It can be a gigantic list of images


    How big a list? 20 50? 100? 500? 1000?

    > Floating above a link will be better .


    BUT the user will still have to download those images to see them, so you
    might as well stick with the 'thumbnails' option. They only need to be 2K
    or less each if they are at a *sensible* size.
     
    Steve R., Mar 4, 2004
    #8
  9. Stijn Goris

    Mark Parnell Guest

    On Thu, 04 Mar 2004 22:14:33 GMT, "Steve R."
    <stevie_ritchie(NOSPAM)@hotmail.com> declared in alt.html:

    > BUT the user will still have to download those images to see them, so you
    > might as well stick with the 'thumbnails' option. They only need to be 2K
    > or less each if they are at a *sensible* size.


    And split them onto separate pages, like most sites do. Say 10-20 per
    page or something. Give the user the option to search/filter which ones
    they look at. If there are that many of them, most users aren't going to
    want to sift through the lot to find what they are looking for anyway.

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
     
    Mark Parnell, Mar 4, 2004
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U2FuamVldiBCaGF0aWE=?=

    Regarding Browse information(ALT-F12) feature same as VS 6.0

    =?Utf-8?B?U2FuamVldiBCaGF0aWE=?=, Apr 6, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    878
    =?Utf-8?B?U2FuamVldiBCaGF0aWE=?=
    Apr 8, 2005
  2. mortb
    Replies:
    0
    Views:
    425
    mortb
    Nov 10, 2004
  3. Sandy

    ALT text block for image

    Sandy, Oct 18, 2004, in forum: HTML
    Replies:
    50
    Views:
    3,927
    Starshine Moonbeam
    Oct 23, 2004
  4. mark4asp
    Replies:
    2
    Views:
    356
    George Ter-Saakov
    Jan 8, 2008
  5. mark4asp
    Replies:
    6
    Views:
    488
    George Ter-Saakov
    Jan 8, 2008
Loading...

Share This Page