I made a simple gallery, using this script to show the images:
$rs = mysql_query('SELECT * FROM images WHERE oferta_id=2');
while($row = mysql_fetch_array($rs))
{
echo '<li onclick="Large()"><img src='.$row['location'].' alt="image"/></li>';
}
and I want to use javascript in a way that when an user click on a certain picture a box pops-up and he sees the picture larger.I think I’m on a right way using onclick in the <li> tag, but have almost no idea how to make the Large() function.Any help on the topic?
Thanks
Leron
i’d just use a jquery plugin or another javascript framework’s plugin. do a google search for “jquery lightbox” and see examples.
there’s definitely no point in writing your own unless you need some specific functionality not available out there or are looking to build your own as a learning exercise.