скрипт в index.php
Код: Выделить всё
function openpicture(name, pic) {
$('.modal').load("getimg.php?name=" + name + "&pic=" + pic);
}
jQuery(function($){
// bind event handlers to modal triggers
$('body').on('click', '.trigger', function(e){
$('#test-modal').modal().open();
});
// attach modal close handler
$('.modal .close').on('click', function(e){
e.preventDefault();
$.modal().close();
});
// below isn't important (demo-specific things)
$('.modal .more-toggle').on('click', function(e){
e.stopPropagation();
$('.modal .more').toggle();
});
});
Код: Выделить всё
echo "<a class='title' " . $row['imgsrc'] . "'>" . $row['name']. "</a>
";
$imgsrc = $row['imgsrc'];
$tname = $row['name'];
echo "<a class='trigger' href='javascript :o penpicture(\"$tname\",\"$imgsrc\")'><img src='img/" . $row['imgsrc'] . "' width='1%' '/></a>
";
Код: Выделить всё
$title = $_GET['name'];
$img = $_GET['pic'];
echo $title;
echo "[align=center]<img src='img/". $img . "'>[/align]";