PHP - shop - help
Posted: Sat Jun 30, 2012 11:31 am
I've made a image gallery with thumbnails and pictures. The thumbnails are under the picture in a horizontal line - that's how I want it.
And I would like to make a simple PHP-shop out of it where you can select the products by clicking on the large images and not the thumbnails or there could be a button under the picture. Can one do that?
Here is the code - made in javascript:
And I would like to make a simple PHP-shop out of it where you can select the products by clicking on the large images and not the thumbnails or there could be a button under the picture. Can one do that?
Here is the code - made in javascript:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>xhtml-test</title>
<meta http-equiv="content-type"
content="text/html;charset=utf-8" />
<style type="text/css">
div {cursor:pointer}
div img {width:50px}
#vis img{width:500px}
</style>
</head>
<body onload=vis2();>
<script type="text/javascript">
function vis2() {
document.getElementById('vis').innerHTML='<img src="blomstto.jpg" alt="billede2" />';
}
</script>
<div id="vis"></div>
<table>
<tr>
<td>
<div onclick="document.getElementById('vis').innerHTML=this.innerHTML" >
<img src="blomst.jpg" alt="billede1" />
</div> </td>
<td>
<div onclick="document.getElementById('vis').innerHTML=this.innerHTML" >
<img src="blomstto.jpg" alt="billede2" />
</div> </td>
<td>
<div onclick="document.getElementById('vis').innerHTML=this.innerHTML" >
<img src="gul_blomst.jpg" alt="billede3" />
</div> </td>
</tr>
</table>
</body>
</html>