I have an image preview plugin. It works perfectly with images that are already in the page.
like:
<a href='ImgHandler.ashx?Id=5' class='preview' title='Landscape'>
<img height='18' width='18' class='ImgInCell' src='ImgHandler.ashx?Id=5' alt='Landscape' /></a>
But When i load the same type of code through Ajax on a DIV layer the image hover preview is not working.
<a id="LinkPic" class="preview" title="Land Scape" href="ImgHandler.ashx?Id=5">
<img id="ImgPic" style="height:50px;width:50px;" src="ImgHandler.ashx?Id=5" alt="Land Scape">
</a>
Then i used firebug and copied the source after the load of AJAX; created a html page; then on loading it, I see the image hover on the AJAX Image is working Fine.
The Jquery code for The image preview is called by following.
$(document).ready(function () {
imagePreview();
});
I think it is not working due to the document.ready . How do i make the image preview work on AJAX data(Image)??
Calling the imagePreview(); after the AJAX call didnt help.
i found no other way than to insert the jquery code into the AJAX called document (partial view) with change in class like
imgpreview2, and now its working fine.