Jump to:

791 Posts in 369 Topics by 303 members

Widgets

SilverStripe Forums » Widgets » LoginWidget's JS conflicting with jQuery

Discuss SilverStripe Widgets.

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

Page: 1
Go to End
Author Topic: 1061 Views
  • BrysaniStudios
    Avatar
    Community Member
    12 Posts

    LoginWidget's JS conflicting with jQuery Link to this post

    I'm in the process of building a site right now using silverstripe. I used a little jQuery to change some CSS on the page and I plan on building a gallery in jQuery as well. But after I implemented the LoginWiget, i noticed it added a bunch of ProtoType JS to the page and my jQuery is no longer working. So I'm guessing that they are conflicting and aren't working to well with eachother. Anyone have some ideas how to get the to work together, or does this mean I have to write the rest of my JS in Prototype. I'd rather work with jQuery because I'm more familiar with it and I need to stay on schedule with this site, so I don't have too much time to learn another Javascript library.

    Any Ideas?
    Thanks,
    Bryant

  • BrysaniStudios
    Avatar
    Community Member
    12 Posts

    Re: LoginWidget's JS conflicting with jQuery Link to this post

    Nevermind I figured it out! I just wrapped a jQuery function around it

    Before

    $("#nav li:last-child").css('border', 'none');

    After

    (function($) {

       $("#nav li:last-child").css('border', 'none');

    })(jQuery);

    1061 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.