Jump to:

23368 Posts in 18143 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » jQuery Cycle Lite Plugin and SilverStripe

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 2
Go to End
Author Topic: 9959 Views
  • banal
    Avatar
    Community Member
    901 Posts

    Re: jQuery Cycle Lite Plugin and SilverStripe Link to this post

    Most likely it's because there's a variable name clash? Could it be that prototype or some other library is being loaded that shadows the $ variable? Maybe you should have a look in firebug which javascript files are being loaded.

  • martimiz
    Avatar
    Forum Moderator
    1067 Posts

    Re: jQuery Cycle Lite Plugin and SilverStripe Link to this post

    I stumbled upon this thread as I'm re. new to jQuery - a bit late maybe, but I thought to let you know anyhow: for me it worked when I added '$' to the function as I saw here: http://docs.jquery.com/Using_jQuery_with_Other_Libraries somewhere halfway down the page.

    <script type="text/javascript">
       jQuery(document).ready(function ($) {
          $('#slideshow').cycle();
       });
    </script>

  • Chip Designs
    Avatar
    Community Member
    15 Posts

    Re: jQuery Cycle Lite Plugin and SilverStripe Link to this post

    Hey Martimiz,

    You're not too late. Your solution is the only one that worked for me. Thanks heaps!!

    Cheers,
    Rob

  • edk
    Avatar
    Community Member
    39 Posts

    Re: jQuery Cycle Lite Plugin and SilverStripe Link to this post

    Another way to do this (Banal actually helped with on another post a while back) is have your JQuery syntax like this...

    ;(function($) {
       $(document).ready(function() {
                
          $('#slideshow1').cycle();

       });
    })(jQuery);

    You just wrap JQuery in this function which will then negate any conflicts of the usage of the '$' sign.

  • doubleedesign
    Avatar
    Community Member
    19 Posts

    Re: jQuery Cycle Lite Plugin and SilverStripe Link to this post

    I know this thread is old but just wanted to say thankyou edk - your sample is the only one that would work for me.

  • SSadmin
    Avatar
    Community Member
    90 Posts

    Re: jQuery Cycle Lite Plugin and SilverStripe Link to this post

    sounds like its a common problem with the conflict between Jquery and prototype lib.

    9959 Views
Page: 1 2
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.