javascript - Fancybox not working - Stack Overflow

How fix this problem in fancybox?Uncaught TypeError: Object #<Object> has no method 'fancybo

How fix this problem in fancybox?

Uncaught TypeError: Object #<Object> has no method 'fancybox' localhost/:74
(anonymous function) http://localhost/:74
o.extend.ready.o.readyList jquery.min.js:19
o.extend.each jquery.min.js:12
o.extend.ready jquery.min.js:19
o.each.o.fn.(anonymous function)

Here is code in header.php I dont know where can be problem! I try use simplemodal but is not working! Maybe is problem with tabslider! I make everything that is write on fancybox website.

<link rel="stylesheet" href="css/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />
<script type="text/javascript" src="js/jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript" src=".4/jquery.min.js"></script>
    <script type="text/javascript">
        $(function(){
            $('.slide-out-div').tabSlideOut({
                tabHandle: '.handle',
                pathToTabImage: 'img/handle-bg.png',
                imageHeight: '186px',
                imageWidth: '30px',
                tabLocation: 'left',
                speed: 300,
                action: 'click',
                topPos: '150px',
                leftPos: '20px',
                fixedPosition: false
            });
    });
    </script>
    <script type="text/javascript">
        $(function(){
            $('.add_site_right').tabSlideOut({
                tabHandle: '.handle_right',
                pathToTabImage: 'img/handle-bg.png',
                imageHeight: '186px',
                imageWidth: '30px',
                tabLocation: 'right',
                speed: 300,
                action: 'click',
                topPos: '150px',
                leftPos: '20px',
                fixedPosition: false
            });
    });
    </script>
    <script type="text/javascript">
            $(document).ready(function() {
                /*
                *   Examples - images
                */

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

                $("a#example2").fancybox({
                    'overlayShow'   : false,
                    'transitionIn'  : 'elastic',
                    'transitionOut' : 'elastic'
                });

                $("a#example3").fancybox({
                    'transitionIn'  : 'none',
                    'transitionOut' : 'none'    
                });

                $("a#example4").fancybox({
                    'opacity'       : true,
                    'overlayShow'   : false,
                    'transitionIn'  : 'elastic',
                    'transitionOut' : 'none'
                });

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

                $("a#example6").fancybox({
                    'titlePosition'     : 'outside',
                    'overlayColor'      : '#000',
                    'overlayOpacity'    : 0.9
                });

                $("a#example7").fancybox({
                    'titlePosition' : 'inside'
                });

                $("a#example8").fancybox({
                    'titlePosition' : 'over'
                });

                $("a[rel=example_group]").fancybox({
                    'transitionIn'      : 'none',
                    'transitionOut'     : 'none',
                    'titlePosition'     : 'over',
                    'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
                        return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
                    }
                });

                /*
                *   Examples - various
                */

                $("#various1").fancybox({
                    'titlePosition'     : 'inside',
                    'transitionIn'      : 'none',
                    'transitionOut'     : 'none'
                });

                $("#various2").fancybox();

                $("#various3").fancybox({
                    'width'             : '75%',
                    'height'            : '75%',
                    'autoScale'         : false,
                    'transitionIn'      : 'none',
                    'transitionOut'     : 'none',
                    'type'              : 'iframe'
                });

                $("#various4").fancybox({
                    'padding'           : 0,
                    'autoScale'         : false,
                    'transitionIn'      : 'none',
                    'transitionOut'     : 'none'
                });
            });
        </script>

How fix this problem in fancybox?

Uncaught TypeError: Object #<Object> has no method 'fancybox' localhost/:74
(anonymous function) http://localhost/:74
o.extend.ready.o.readyList jquery.min.js:19
o.extend.each jquery.min.js:12
o.extend.ready jquery.min.js:19
o.each.o.fn.(anonymous function)

Here is code in header.php I dont know where can be problem! I try use simplemodal but is not working! Maybe is problem with tabslider! I make everything that is write on fancybox website.

<link rel="stylesheet" href="css/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />
<script type="text/javascript" src="js/jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript" src="http://ajax.googleapis./ajax/libs/jquery/1.4/jquery.min.js"></script>
    <script type="text/javascript">
        $(function(){
            $('.slide-out-div').tabSlideOut({
                tabHandle: '.handle',
                pathToTabImage: 'img/handle-bg.png',
                imageHeight: '186px',
                imageWidth: '30px',
                tabLocation: 'left',
                speed: 300,
                action: 'click',
                topPos: '150px',
                leftPos: '20px',
                fixedPosition: false
            });
    });
    </script>
    <script type="text/javascript">
        $(function(){
            $('.add_site_right').tabSlideOut({
                tabHandle: '.handle_right',
                pathToTabImage: 'img/handle-bg.png',
                imageHeight: '186px',
                imageWidth: '30px',
                tabLocation: 'right',
                speed: 300,
                action: 'click',
                topPos: '150px',
                leftPos: '20px',
                fixedPosition: false
            });
    });
    </script>
    <script type="text/javascript">
            $(document).ready(function() {
                /*
                *   Examples - images
                */

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

                $("a#example2").fancybox({
                    'overlayShow'   : false,
                    'transitionIn'  : 'elastic',
                    'transitionOut' : 'elastic'
                });

                $("a#example3").fancybox({
                    'transitionIn'  : 'none',
                    'transitionOut' : 'none'    
                });

                $("a#example4").fancybox({
                    'opacity'       : true,
                    'overlayShow'   : false,
                    'transitionIn'  : 'elastic',
                    'transitionOut' : 'none'
                });

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

                $("a#example6").fancybox({
                    'titlePosition'     : 'outside',
                    'overlayColor'      : '#000',
                    'overlayOpacity'    : 0.9
                });

                $("a#example7").fancybox({
                    'titlePosition' : 'inside'
                });

                $("a#example8").fancybox({
                    'titlePosition' : 'over'
                });

                $("a[rel=example_group]").fancybox({
                    'transitionIn'      : 'none',
                    'transitionOut'     : 'none',
                    'titlePosition'     : 'over',
                    'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
                        return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
                    }
                });

                /*
                *   Examples - various
                */

                $("#various1").fancybox({
                    'titlePosition'     : 'inside',
                    'transitionIn'      : 'none',
                    'transitionOut'     : 'none'
                });

                $("#various2").fancybox();

                $("#various3").fancybox({
                    'width'             : '75%',
                    'height'            : '75%',
                    'autoScale'         : false,
                    'transitionIn'      : 'none',
                    'transitionOut'     : 'none',
                    'type'              : 'iframe'
                });

                $("#various4").fancybox({
                    'padding'           : 0,
                    'autoScale'         : false,
                    'transitionIn'      : 'none',
                    'transitionOut'     : 'none'
                });
            });
        </script>
Share Improve this question edited Jun 22, 2012 at 11:40 Allen asked Jun 22, 2012 at 11:31 AllenAllen 952 silver badges10 bronze badges 1
  • Are you included fancybox script properly? – antyrat Commented Jun 22, 2012 at 11:33
Add a ment  | 

2 Answers 2

Reset to default 3

You need to include fancybox script after jquery:

<script type="text/javascript" src="http://ajax.googleapis./ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.fancybox-1.3.4.pack.js"></script>

Your site adzire. throws javascript errors so that is making some of your scripts (including fancybox) to fail. You need to tide up your code a bit:

First, you only need a single instance of jQuery (ideally the latest version), so far you have 3 (1.4, 1.6.2 and 1.7.2). I guess you should remove v1.4 and 1.6.2 (some plugins include a copy jQuery but it doesn't mean you need them all.) Also make sure that load jQuery before any other script or jQuery plugin.

Second, same as jQuery, you only need a single instance of any of your jQuery plugins. You are loading jQuery UI 1.8.21 twice ... remove one. I guess because you load each of them after a different version of jQuery, it creates these erros:

Timestamp: 22/06/2012 11:35:54 AM
Error: $(".cont .wrapper .block select.styled").select_skin is not a function
Source File: http://www.adzire./js/main.js
Line: 6

Timestamp: 22/06/2012 11:36:03 AM
Error: detailsBox is not defined
Source File: http://www.adzire./
Line: 115

A bit of clean up might fix your issues, including fancybox issue.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744235277a4564443.html

相关推荐

  • javascript - Fancybox not working - Stack Overflow

    How fix this problem in fancybox?Uncaught TypeError: Object #<Object> has no method 'fancybo

    8天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信