views:

221

answers:

0

I'm trying to change the class of the cboxWrapper when a certain colorbox link is clicked.

For example:

    $(".register_box").click(function(){
        var url = $(this).attr('href') + '-up';
        $.fn.colorbox({open: true, width: "550px", height: "440px",
initialWidth: "550px", initialHeight: "440px", transition: "none",
iframe: true, title: true, href: url });
        return false;
    });

    $(".follow_box").click(function(){
        var url = $(this).attr('href') + '&ajax=true';
        $.fn.colorbox({open: true, width: "580px", height: "380px",
initialWidth: "580px", initialHeight: "380px", transition: "none",
iframe: true, title: true, href: url });
        return false;
    });

When a .register_box link is clicked, I'd like it to load:

#cboxWrapper {background: url(images/popup_login_header.gif) no-
repeat; padding-top: 0px; margin-top: 0px;}

And when a .follow_box link is clicked, I'd like it to load:

#cboxWrapper {background: url(images/popup_follow_header.gif) no-
repeat; padding-top: 0px; margin-top: 0px;}

Can I create two separate classes and call the correct one each time a link is clicked? Or, can i change the cboxWrapper on the fly? Any advice?

Thanks, Mike