SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: JQuery issue with Throbber plugin

  1. #1
    SitePoint Member
    Join Date
    Jan 2010
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    JQuery issue with Throbber plugin

    Hi,

    I'm very new to JQuery (and Javascript) for that matter and would very much appreciate some help.

    What I want to do probably seems very trivial, but it's proving pretty confusing with me.

    I have a Javascript file in which I'll be keeping various selector scripts originating from different plugins. I understand that '$(document).ready(function()' is the correct way to start off all scripts.

    At the moment, I have the this:-

    Code:
    $(document).ready(function() {
    
      var showText='more info';
      var hideText='close';
      var is_visible = false;
    
      $('.toggle').prev().append('<a href="#" class="toggle-link">'+showText+'</a>');
      $('.toggle').hide();
    
      $('a.toggle-link').click(function() {
        is_visible = !is_visible;
        $(this).html( (!is_visible) ? showText : hideText);
        $(this).toggleClass('close');
        $(this).parent().next('.toggle').toggle('fast');
        return false;
      }); 
    
      $("#foo .submit").throbber("click", {image: "/images/throbber.gif"});
      
    });
    I am having issues with integrating '$("#foo .submit").throbber("click", {image: "/images/throbber.gif"});' into this file. Everytime I try and load the file, it says that it isn't a function - does that mean every statement like this needs to be put into it's own function? If this is correct, could someone please show me how I would do this?

    Thanks for your help in advance
    Ben

  2. #2
    Team SitePoint Mal Curtis's Avatar
    Join Date
    Jul 2009
    Location
    New Zealand
    Posts
    322
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    Are you definitely including the Throbber javascript plugin in the page?

    i.e you've got a script tag for jQuery, then a script tag for Throbber?

    P.S. What is throbber?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •