Grow your CSS skills. Land your dream job.

jquery afrer ajax .load use jquery on text

  • # November 27, 2009 at 2:52 am

    Hi.
    I would like to load a page with jquery .load, and then do some changes on loaded page with some jquery functions.
    so it will look like this:

    Code:
    $(“#tempcont”).load(target, function() {
    $(“#center-inner .maincontent”).css(‘display’, ‘none’);
    $(“#center-inner .maincontent”).fadeIn();
    });

    But i need to do the same thing in other places (do the stuff on loaded content), so I was wondering, maybe i will make a function:

    Code:
    $.fn.doactions = function() {
    $(“#center-inner .maincontent”).css(‘display’, ‘none’);
    $(“#center-inner .maincontent”).fadeIn();
    });
    }

    and then call it when i need it:

    Code:
    $.doaction;

    but it seems not to work (i got no errors, but actions are not working).

    Where is the error?

    Thanks in advice.

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