I have a problem and possible solution but I'd appreciate a little help with using it.
I have a ASP.NET Timer and when it Ticks I call asynchronously web service method that returns me a photo. I have a image in Update Panel and update it src when I get a photo. I'm using a jQuery lightBox plugin to preview a image. The mechanism works but on a partial postbacks image loses attatched plugin. So I need re-attaching functionality to elements within UpdatePanels.
Possible solution is using ASP.NET AJAX’s pageLoad() to re-attach (http://encosia.com/simplify-aspnet-ajax-client-side-page-initialization/)
I attach plugin with:
<script type="text/javascript">
$(function () {
$('#gallery a').lightBox({ fixedNavigation: true });
});
</script>
As it is said pageLoad() should solve the problem, but how to modify this js to use pageLoad ?
1)How sholud look my js script ? I'm a begginer with js so please help me.
2)Moreover, should I attach sth to my project to use pageLoad() ?
Thanks in advance for Your help.