I apologize upfront for my lack of jquery knowledge. In this website I am building, a user is presented with a number of thumbnail images representing plants. When a thumbnail i
Im pretty sure you dont need to query PHP each time ... something like this would work :
This would be the output from your server side (php if thats what your using) - it stores the ID of the image in the data
attribute
JavaScript :
$(document).ready(function() {
$('.imglink').click(function(event) {
event.preventDefault();
$('dialogid')
.data('image_id', $(this).data('id'))
.dialog('open');
})
})
the image id from the data
attribute is then passed to the data
attribute of the dialog. This attribute can be accessed using $(this).data('image_id')
form within the dialog then