php - How to display content in a modal box with images in that box -


currently have detailed page listing containing links page.php contains page.php?id=1, page.php?id=2, page.php?id=3, page.php?id=4..etc . want provide preview button on over clicking button without navigating these pages, can show content in popup/modal box without moving these pages? stuck id concept how can achieve this. source/link appreciable.

you perform ajax call jquery based on button clicked, load page inside dialog:

$('.previewbutton').click(function(){             // determine page id load      // based on button clicked     var pageid = ...;      // fetch page     $.get('page.php', {page: pageid}, function(data) {         // show page content inside dialog         $('.mydialog').html(data);     }); }); 

for dialog example use jquery ui's dialog: http://jqueryui.com/demos/dialog/

with plugin can call $(".mydialog").dialog() make <div class="mydialog"></div> show pretty dialog.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -