SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard donboe's Avatar
    Join Date
    Jun 2010
    Location
    Netherlands
    Posts
    2,161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    fancybox.ajax not functioning

    Why is this:
    HTML Code:
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <style>
    * {
     margin: 0;
     padding: 0; 
    }
    html,
    body {
     width: 100%;
     height: 100%; 
    }
    
    body {
     background: #CCC; 
    }
    #menu {
     display: block;
     margin: 100px auto; 
    }
    </style>
    <link
          rel="stylesheet"
          type="text/css"
          href="css/jquery.fancybox.css"> 
          <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
          <script type="text/javascript" src="js/site/jquery.fancybox-1.3.4.pack.js"></script>
    </head>
    <body>
    <ul id="menu">
      <li><a class="various fancybox.ajax" href="content.php">Ajax</a></li>
    </ul>
    <script type="text/javascript">
    $(document).ready(function() {
        $(".various").fancybox({
            maxWidth    : 800,
            maxHeight   : 600,
            fitToView   : false,
            width       : '70%',
            height      : '70%',
            autoSize    : false,
            closeClick  : false,
            openEffect  : 'none',
            closeEffect : 'none'
        });
    });
    </script>
    </body>
    </html>
    not functioning while I have it straight from the Fancybox website and all things(plugins css and images) are in place. Instead of opening content in Fancybox It opens by it self as you can see here
    “Good artists copy, great artists steal” (Pablo Picasso - 1934)

  2. #2
    Grüße aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    6,047
    Mentioned
    219 Post(s)
    Tagged
    12 Thread(s)
    Hi donboe,

    If you look at the console you see:

    Code:
    Uncaught TypeError: Cannot read property 'msie' of undefined jquery.fancybox-1.3.4.pack.js:18
    The reason for this is that $.browser was removed from jQuery starting with version 1.9. It is now available as a plugin.

    Try reverting to jQuery 1.8 and see if that helps.

  3. #3
    SitePoint Wizard donboe's Avatar
    Join Date
    Jun 2010
    Location
    Netherlands
    Posts
    2,161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Pullo. Thank you for notifying me about this. I t had to do with this one:
    Code:
    <script type="text/javascript" src="js/site/jquery.fancybox-1.3.4.pack.js"></script>
    I replaced it with the normal fancybox:
    Code:
    <script type="text/javascript" src="js/site/jquery.fancybox.js"></script>
    and it is working great!
    “Good artists copy, great artists steal” (Pablo Picasso - 1934)

  4. #4
    Grüße aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    6,047
    Mentioned
    219 Post(s)
    Tagged
    12 Thread(s)
    Good stuff!

    That is actually the better solution as it's generally recommended to avoid browser detection, which is why the method was removed.

    I wasn't sure if fancybox had caught up or not , but obviously it has


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •