Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Openfield Creative 62 posts 222 karma points
    Apr 02, 2014 @ 16:49
    Openfield Creative
    0

    Javascript Plugin not displaying in preview mode

    I'm using owl carousel as both a standard carousel and as a banner rotator and everything is working fine. That is until I enter preview mode. Loading a page in preview causes the plugin to stop working completely, I am getting a js error saying that $(...)owlcarousel is not a function.  Has anyone run in to something similar or could offer an explanation of why this might be happening?

     

    Thanks

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 02, 2014 @ 17:17
    Jan Skovgaard
    0

    Hi Owen

    What version of Umbraco are you using?

    /Jan

  • Openfield Creative 62 posts 222 karma points
    Apr 02, 2014 @ 17:20
    Openfield Creative
    0

    I guess that would be helpful information.  I'm using 6.1.6.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 02, 2014 @ 21:37
    Jan Skovgaard
    0

    Hi Owen

    Well that sure is an odd issue. Not something I've seen before on that version.

    Do you see any related error messages in the /app_data/logs file?

    /Jan

  • Openfield Creative 62 posts 222 karma points
    Apr 02, 2014 @ 22:04
    Openfield Creative
    0

    Unfortunately, there is nothing in the trace log related to the issue. I'm including the head section of my template as well as the calls to the javascript functions that are failing.

    head section:

    <link rel="stylesheet"  href="/css/jquery.mobile.custom.structure.css" />  
    <link href='http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:400,300|Amatic+SC:700' rel='stylesheet' type='text/css'>
    <link href="/fonts/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
    <link href="/fonts/icons.css" rel="stylesheet" type="text/css" media="screen" />
    <link href="/less/styles.less" rel="stylesheet" type="text/css" media="screen" />
    <link rel='stylesheet' id='camera-css'  href='/css/rte.css' type='text/css' media='all'> 
    <link rel='stylesheet' id='camera-css'  href='/css/camera.css' type='text/css' media='all'> 
    
    <script type="text/javascript" src="/scripts/jquery-1.11.0.min.js"></script>
    <script type="text/javascript" src="/scripts/htmlhelper.js"></script>
    
    <!----------Owl Carousel------->
        <!-- Important Owl stylesheet -->
    <link rel="stylesheet" href="/owl-carousel/owl.carousel.css">
    
    <!-- Default Theme -->
    <link rel="stylesheet" href="/owl-carousel/owl.theme.css">
    
    <!-- Include js plugin -->
    <script src="/owl-carousel/owl.carousel.js"></script>
    
    
    <script>
        $(document).bind("mobileinit", function () {
            $.mobile.loadingMessage = false;
        });
    </script>
    

    and the failing function calls:

       $(document).ready(function () {
    
           $("#carousel").owlCarousel({
               pagination: false,
                itemsCustom: [
                    [0, 1],
                    [720, 2],
                    [1024, 3],
                    [1300, 4],
                    [1600, 5]
               ],
               rewindNav: false,
               navigation: true,
               navigationText: ["<img src='/images/g_rotatorArrowLeft.png' />", "<img src='/images/g_rotatorArrowright.png' />"]
           });
    
           $("#rotator").owlCarousel({
               pagination: false,
               rewindNav: true,
               navigation: true,
               singleItem: true,
               autoPlay: true,
               navigationText: ["<img src='/images/g_rotatorArrowLeft.png' />", "<img src='/images/g_rotatorArrowright.png' />"]
           });
    
       });                  
    
    $(".navEqualHeight").navEqualHeight();
    

    this is wrapped in script tags but for some reason the editor isn't displaying the end script tag so I remove them altogether.

    Thanks, Owen

Please Sign in or register to post replies

Write your reply to:

Draft