dynamic content

  • Thread starter Matthew Robinson
  • Start date
M

Matthew Robinson

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
 
K

kaeli

@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

--
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top