I’m having troubles to get working captify plugin in CListView.
Default load of page is OK, captify is working. However when ajax pagination is called, captify stops working because it needs to be rebound on pager links.
This is my solution, which is not working unless I specify alert before rebind:
<?php
Yii::app()->clientScript->registerScript('initVideoList',<<<EOD
$('.yiiPager a').live('click', function() {
alert('try captify now'); // <-- without this line rebind is not working
$('img.captify').captify({}); // rebind
});
$('img.captify').captify({}); // this is for default page load (not for ajax)
EOD
, CClientScript::POS_READY);
?>
I suspect its going to be a silly mistake, but anyone could shed a light on this behavior? It is driving me crazy…
Seems like you call captify too soon, and the images are not yet refreshed… you can solve this by using setTimeout() to execute captify after the specified time…