简体   繁体   中英

Fancybox is not working with simple link

Please developers, I did everything over and over and can't seem to find out why fancybox plugin refuses to work. I think its the javascript below that suppose to fire the plugin.

<script type="text/javascript">
$(document).ready(function() {

    /* This is basic - uses default settings */

    $("a#contactus").fancybox();

    /* Using custom settings */

    $("a#inline").fancybox({
        'hideOnContentClick': true
    });

    /* Apply fancybox to multiple items */

    $("a.group").fancybox({
        'transitionIn'  :   'elastic',
        'transitionOut' :   'elastic',
        'speedIn'       :   600, 
        'speedOut'      :   200, 
        'overlayShow'   :   false
    });

});
</script>

Open your console (F12) and notice the errors?

Fancybox seems to use $.browser , which was removed in jQuery 1.9, and that's an error!

Also, $("a#contactus").fancybox(); is an error! There is no such element, you do however have a div with that ID ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM