I’m having some problems and wanted to see if anyone knew how to resolve my issues. I’m using fancybox to call another page. Everything returns fine except i need the tinyscrollbar to apply to the content returned in ajax so that the user can scroll to view the complete content. I’ve tried using .on but not sure if i’m doing it right. i’ve used the following codes:
$(document).ready( function()
{
$("a.lightbox").fancybox({
'titlePosition' : 'inside',
'transitionIn' : 'none',
'transitionOut' : 'none'
});
$("a.lightbox").on( 'load', function() {
$('#scrollable').tinyscrollbar();
});
});
and
$(document).on("click", "a.lightbox", function() {
alert( 'hello' );
$('#scrollable').tinyscrollbar();
});
Neither work. If i add an alert then it seems to work:
$(document).ready( function()
{
$("a.lightbox").fancybox({
'titlePosition' : 'inside',
'transitionIn' : 'none',
'transitionOut' : 'none'
});
$("a.lightbox").on( 'load', function() {
alert( "hello world" );
$('#scrollable').tinyscrollbar();
});
});
Any one know how to get jquery to apply to the ajax’d content?