Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fancybox callbackOnShow not working

I am trying to call a function on the load of the fancybox dialog(content loaded as iFrame) but call to the "callbackOnShow" is not working. Appreciate any help on this.

here's the code snippet:

jQuery:

$("#link1").fancybox({
        'width': '50%',
        'height': '50%',
        'autoScale': false,
        'transitionIn': 'none',
        'transitionOut': 'none',
        'type': 'iframe',
        'callbackOnShow': function () {            
                alert("Hello");            
        }
    });

HTML code which is shown in the fancybox:

<div>
    <div class="signup">            
        <div id="test">         
            <a id="Log" class="but" href="#"><strong>Sign in</strong> </a>          
    </div> 
    </div>
</div>
like image 722
Sampat Avatar asked Mar 31 '26 07:03

Sampat


1 Answers

I dont see the callbackOnShow @ http://fancybox.net/api ?
Which fancybox are you using ? can you add it to a fiddle ?

Fancybox provides onComplete option as it works fine when the show is completed.
Demo - http://jsfiddle.net/SrT4T/

like image 89
Jayendra Avatar answered Apr 02 '26 20:04

Jayendra



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!