Making sure Lightbox still works in Ajax UpdatePanel


I recently updated the homepage portfolio section with an Ajax filtering dropdown, allowing readers to filter my portfolio with different technologies and themes. However, that caused my old lightbox effect to lose ground somehow. After days of debugging, I found a way to deal with it, that is I had to manually reinstantiate the lightbox object on page load (clientside), because whenever Ajax fires up a postback, it wipes of the Lightbox entity that was created.

<script type="text/javascript">
    function pageLoad() {
        $('#gallery a.image-thumb').lightBox({ fixedNavigation: true });
    }
script>

yani:

script type="text/javascript"
$(document).ready(function() {
$("a[rel='example1']").colorbox();
});
/script

ek olarak;

script type="text/javascript"
function pageLoad() {
$("a[rel='example1']").colorbox();
}
/script

yazmak gerekecek.

http://www.alectang.com/Blog/Archive/2009/09/17/Making-sure-Lightbox-still-works-in-Ajax-UpdatePanel-53.aspx

http://stackoverflow.com/questions/520645/jquery-datepicker-ms-ajax-updatepanel-doesnt-work-after-post-back

http://www.mail-archive.com/jquery-en@googlegroups.com/msg37808.html

search this blog (most likely not here)