Hi All,
I have tried a lot to solve this issue and finding no way I am here ?
The objective is that there are some images and each have their description.Now upon onclick every image the description and the image will be shown separately at a single place.
I have done some coding but stopped at displaying the image description onclick.onclick the images are coming without any problem but their respective description is not coming.Here is the code:
Javascript:
[CODE]<script type=”text/javascript”>
function change(which , t) {
var text = t;
document.getElementById(‘txt’).innerHTML=text;//this is not working
document.getElementById(‘main’).src=”petpic/” + which;
}
</script>
<img id=”main” src=”petpic/<?=$lpr1[‘filename’];?>” width=”400″ height=”300″ border=”0″>
[code=php]<?
$lps=mysql_query(“SELECT * FROM album where pid='{$_GET[‘p’]}'”);
$i = 1;
while($lpr=mysql_fetch_array($lps)){
if($lpr[‘filename’]!=””){?>
<img src=”pic/<?=$lpr[‘filename’];?>” alt=”alt” width=”72″ height=”72″ border=”0″ onclick=”change(‘<?=$lpr[‘filename’];?>,<?=$lpr[‘des’];?>’);” />
<?}else{?>
<img src=”main_images/default.gif” alt=”alt” width=”80″ height=”80″ border=”0″ />
<?}}?>
Please suggest me how can i display the image description for each onclick each image separately.
Thanks in advance for your co-operation like previous.
Raj