dynamic content

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matthew Robinson

    dynamic content

    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
  • kaeli

    #2
    Re: dynamic content

    In article <pan.2004.02.07 .13.24.17.19571 3
    @microsoftscrap pywebserver.com >, mattyrobinson69
    @microsoftscrap pywebserver.com enlightened us with...[color=blue]
    >
    > 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.[/color]

    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.


    &start=10&sa =N


    &q=php+thumbnai l&sa=N&tab=wg

    --
    --
    ~kaeli~
    A man needs a mistress... just to break the monogamy.



    Comment

    Working...