Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Convert jQuery snippit to work in noConflict mode

  • 20-06-2011 5:11pm
    #1
    Registered Users, Registered Users 2 Posts: 6,571 ✭✭✭


    I am trying to incorporate jScroller ticker into a WordPress site but having problems with the noConflict code.

    The docs give the following example code:
    <script type="text/javascript">
     $(document).ready(function(){
    
      // Add Scroller Object
      $jScroller.add("#scroller_container","#scroller","left",1);
    
      // Start Autoscroller
      $jScroller.start();
     });
    </script>
    
    As jQuery in WordPress runs in "no conflict" mode, I tried converting this to:
    jQuery(document).ready(function($) {
      // Add Scroller Object
      $jScroller.add("#news-ticker","#tickercontainer","left",1);
    
      // Start Autoscroller
      $jScroller.start();
     });
    
    The error console in Firefox says "$ is not a function" for the code in the jScroller file (it is packed so I cannot figure exactly what code is causing the problem).

    Can I fix this with my code or would the jScroller code have to be changed?

    Aside, I was using liScroll but it seems to be CPU intensive.


Comments

  • Registered Users, Registered Users 2 Posts: 6,571 ✭✭✭daymobrew


    I got somewhere with this: in the jscroller-0.4.js file I changed all $() references to jQuery().


Advertisement