Grow your CSS skills. Land your dream job.

jQuery plugin on wordpress

  • # February 18, 2010 at 5:12 pm

    Hi everybody!

    I was trying to use the idleTimer plugin on wordpress ( http://paulirish.com/2009/jquery-idletimer-plugin/ ) , but it keeps telling me that "idleTimer is not a function".

    The JS file is being loaded at the header,right after the jquery file, I can see that. I think it has to be a problem with the jQuery scope, which is kind of weird in WordPress. But I’ve tried every possible solution that I found on the internet, and none worked.

    I’ve tried using var $ = jQuery.noConflict(); and then

    Code:
    (function($){

    $(document).bind(“idle.idleTimer”, function(){

    });

    $(document).bind(“active.idleTimer”, function(){

    }).trigger(‘active.idleTimer’);

    $.idleTimer(5000);

    })(jQuery);

    but it doesnt work. Maybe I have to change the plugin file?
    The plugin file defines the function like

    Code:
    (function($){

    $.idleTimer = function f(newTimeout){
    // Stuff

    }; // end of $.idleTimer()

    })(jQuery);

    Any ideas? Thank you.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".