dynamic content

Discussion in 'Javascript' started by Matthew Robinson, Feb 7, 2004.

  1. i wrote a website for somebody, in php and mysql. The person i wrote it
    for wanted it to be as simple to administer as possible, so i set up
    phpmyadmin for the database, and showed him how to upload pictures using
    ftp (productid.jpg). so i scaled these pictures down to small pictures
    (bad practice i know, but he wants it simple), and onclick it shows the
    pictures full size in a new window.

    anyway, theres a problem with the speed. obviously once there are a few
    items on the page, the pictures are going to really slow down the page, so
    i was wondering if there is anyway to have a button by each item, then
    onClick, replace the button with the relevant picture. it has to be
    dynamic, and there's going to be different buttons with different pictures
    on each item, so the code cant go in the <head>

    the page is http://www.houseproudlancs.co.uk/search.php
    Matthew Robinson, Feb 7, 2004
    #1
    1. Advertising

  2. Matthew Robinson

    kaeli Guest

    In article <pan.2004.02.07.13.24.17.195713
    @microsoftscrappywebserver.com>, mattyrobinson69
    @microsoftscrappywebserver.com enlightened us with...
    >
    > anyway, theres a problem with the speed. obviously once there are a few
    > items on the page, the pictures are going to really slow down the page, so
    > i was wondering if there is anyway to have a button by each item, then
    > onClick, replace the button with the relevant picture.


    Target browser(s)?
    If you need to support all browsers, including NN4, then it's more of a
    PITA.

    If not, just have a div with a unique id for each pic, buttons, and an
    onClick for each button that passes the src for the pic and the div id
    to a function. The function creates an image (createElement) with that
    src and appends it (appendchild) to the div. That technique will work in
    all browsers that support those DOM methods, including IE5+, NN6+,
    Mozilla, and Opera 6(5?)+.

    However, this seems a bit much when you could just thumbnail the pics.
    There's PHP thumbnail programs out there.

    http://www.google.com/search?q=php thumbnail&hl=en&lr=&ie=UTF-8&oe=UTF-8
    &start=10&sa=N

    http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8
    &q=php+thumbnail&sa=N&tab=wg

    --
    --
    ~kaeli~
    A man needs a mistress... just to break the monogamy.
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
    kaeli, Feb 9, 2004
    #2
    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. J.Edwards
    Replies:
    0
    Views:
    1,667
    J.Edwards
    Jan 20, 2006
  2. TheKeith
    Replies:
    20
    Views:
    106,428
    Chris Morris
    Oct 29, 2003
  3. hazz
    Replies:
    6
    Views:
    49,560
    SkyUCHC
    Jun 9, 2010
  4. Stanimir Stamenkov
    Replies:
    2
    Views:
    744
    Stanimir Stamenkov
    Oct 25, 2005
  5. Kurt
    Replies:
    0
    Views:
    186
Loading...

Share This Page