0

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>
Jes
  • 59
  • 7
  • possible duplicate of [Fancybox doesn't work with jQuery v1.9.0 \[ f.browser is undefined / Cannot read property 'msie' \]](http://stackoverflow.com/questions/14344289/fancybox-doesnt-work-with-jquery-v1-9-0-f-browser-is-undefined-cannot-read) – JFK Feb 22 '13 at 03:11
  • how to solve it http://stackoverflow.com/a/14344290/1055987 – JFK Feb 22 '13 at 03:12

1 Answers1

0

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 ?

adeneo
  • 312,895
  • 29
  • 395
  • 388
  • yes the div is there but when you go to the site you have to click the white button – Jes Feb 22 '13 at 03:08
  • You are targeting an anchor with that ID, not a div. As for jQuery, you either need a version pre 1.9, or see if fancybox has something that's up to date and works with 1.9, or use the [browser shim](http://greatwebguy.com/jquery-2/browser-detection-shim-for-jquery-1-9/). – adeneo Feb 22 '13 at 03:10
  • so basically change everything $browser to just browser in the plugin code? – Jes Feb 22 '13 at 03:12
  • does 1.8.3 have the $browser issue or can i replace it with that – Jes Feb 22 '13 at 03:23
  • @Jes you can rollback to jQuery v1.8.3 to solve your issue, check http://stackoverflow.com/a/14344290/1055987 – JFK Feb 22 '13 at 03:31