Posted By

erraja_07 on 03/18/11


Tagged


Versions (?)

Expand and collapse using Images


 / Published in: JavaScript
 

  1. function toggleMessages(id)
  2. {
  3. $("#msg_wrapper_"+id).slideToggle('slow');
  4. var src = ($("#arrow_"+id).attr("src") === "images/default/community/arrow_red_down.png")? "images/default/community/arrow_red_up.png" : "images/default/community/arrow_red_down.png";
  5. $("#arrow_"+id).attr("src", src);
  6.  
  7. var title = ($("#arrow_"+id).attr("title") === "Expand")? "Collapse" : "Expand";
  8. $("#arrow_"+id).attr("title", title);
  9.  
  10. //$("#arrow_"+id).attr("src","images/default/community/arrow_red_up.png");
  11.  
  12. }(

Report this snippet  

You need to login to post a comment.