Jump to:

22992 Posts in 11842 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » $silverstripenavigator kills the carousel

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1076 Views
  • JMagnusson
    Avatar
    Community Member
    29 Posts

    $silverstripenavigator kills the carousel Link to this post

    Hello.
    I tried to use a jQuery Carousel (http://www.bkosborne.com/jquery-feature-carousel). But with $SilverStripeNavigator I get this error: "jquery-1.5.1.min.js:16Uncaught TypeError: Object #<Object> has no method 'featureCarousel'".
    How can I solve this problem?

    Thanks/ Johan

  • Webdoc
    Avatar
    Community Member
    329 Posts

    Re: $silverstripenavigator kills the carousel Link to this post

    Can i see the head code of your page.ss did u add the js loading there

  • JMagnusson
    Avatar
    Community Member
    29 Posts

    Re: $silverstripenavigator kills the carousel Link to this post

    Right now it is like this.
    I have removed the $SilverStripeNavigator from the page type, but I hope for another way to solve it.

    <!DOCTYPE html>
    <html lang="sv" xmlns:fb="http://www.facebook.com/2008/fbml">
       <head>
          <% base_tag %>
          <title><% if MetaTitle %>$MetaTitle<% else %>$Title<% end_if %> &raquo; $SiteConfig.Title</title>
          $MetaTags
          <link rel="shortcut icon" href="$ThemeDir/images/favicon.ico" ></link>
          <script type="text/javascript" src="mysite/javascript/jquery-1.2.2.pack.js"></script>
          <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Droid+Serif:regular,italic,bold,bolditalic" type="text/css"></link>
          <% require themedCSS(typography) %>
          <% require themedCSS(layout) %>
          <% require themedCSS(form) %>
          <% require themedCSS(homepage) %>
          <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
          <script type="text/javascript" src="$ThemeDir/scripts/hover.js"></script>
          <script type="text/javascript" src="mysite/javascript/facebox.js" ></script>
          <link rel="stylesheet" type="text/css" href="mysite/css/facebox.css" media="screen" ></link>

    <script type="text/javascript">
    jQuery(document).ready(function($) {
    $('a[rel*=facebox]').facebox()
    })
    </script>

          <!-- For homepage carousel -->
          <link rel="stylesheet" href="$ThemeDir/css/feature-carousel.css" charset="utf-8" ></link>
          <script src="$ThemeDir/scripts/jquery-1.5.1.min.js" type="text/javascript" charset="utf-8"></script>
          <script src="$ThemeDir/scripts/jquery.featureCarousel.min.js" type="text/javascript" charset="utf-8"></script>
          
          
          
          <script type="text/javascript">
          $(document).ready(function() {
             $("#carousel").featureCarousel({
             // include options like this:
             // (use quotes only for string values, and no trailing comma after last option)
             // option: value,
             trackerIndividual: false,
             trackerSummation: false,
             topPadding:5,
             captionBelow: false

             });
          });
          </script>

       </head>

    No file is missing, as far as I can see in firebug.

    Thanks!

  • Willr
    Avatar
    Forum Moderator
    5464 Posts

    Re: $silverstripenavigator kills the carousel Link to this post

    You should wrap your javascript code in a closure to ensure it doesn't conflict - http://doc.silverstripe.org/sapphire/en/topics/javascript#custom-jquery-code

    1076 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.