Thanks! I have managed to fix my code as well:
// photo $(".photo").click(function() { $(".jq").hide().load("page.php?p=photo", function() { $(this).slideDown("slow"); }); $("#closerbutton, #editbutton").removeClass().addClass("phox").show("slow"); return false; }); // edit-photo button $("#editbutton").click(function() { if ( $(this).hasClass("phox") ) $(".jq").hide().load("edit.php?edit=photo", function() { $(this).slideDown("slow"); }); }); Basically, I fixed it by adding an empty class with some unique name. If edit button recognizes that name then it loads the required page. That way I can have xyz pages and xyz corresponding edit buttons that perform well. If someone has a better way, please feel free to correct me. I'm still learning! :) Thanks! On Oct 8, 10:58 pm, MorningZ <[EMAIL PROTECTED]> wrote: > http://docs.jquery.com/Selectors/multiple#selector1selector2selectorN > > $(".closerbutton, .editbutton").show("slow"); > > On Oct 8, 4:42 pm, ivframes <[EMAIL PROTECTED]> wrote: > > > > > > > First of all, is it possible to concatenate events with similar (the > > same) functions? > > > For example: > > > $(".closerbutton").show("slow"); > > $(".editbutton").show("slow"); > > > ...would be like $(".editbutton", ".closerbutton")... I know that's > > not possible, but is there another way? > > > I also need help with a script. > > > $(function() { > > $(".portfolio").click(function() { > > $(".jq").load("/portfolio/", function() { > > $(this).slideDown("slow"); }); > > $(".closerbutton").show("slow").attr("title", "close"); > > $(".editbutton").show("slow").attr("title", "edit"); > > > $(".editbutton").click(function() { > > $(".jq").load("edit.php?edit=portfolio", function() { > > $(this).slideDown("slow"); > > }); > > }); > > }); > > > }); > > > So when someone clicks on .portfolio this will happen: > > > - load the page & slidedown > > - show both close & edit buttons > > - if someone click on the edit button it will load the particular edit > > page for portfolio. > > > This works only when there's no <a href> link. > > If I provide the link in HTML, it'll load instead of this jQuery > > script. If I put "return false" before .editbutton click function, it > > will work, but editbutton won't be attached to ".portfolio" and will > > be generic. For every page I want one edit button that will alter just > > that particular page. > > > I hope I was clear enough for someone to understand! :D Thanks!!