Posted By

Freebit on 10/02/09


Tagged

ajax jquery dialog Generic nested


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

vali29


JQuery generic dialog example part 2/2


 / Published in: jQuery
 

  1. <script type="text/javascript">
  2. $(function() {
  3. // prepare second dialog
  4. $("#second_dialog").dialog({
  5. autoOpen: false,
  6. bgiframe: true,
  7. resizable: true,
  8. height:400,
  9. width: 800,
  10. modal: true,
  11. buttons: {
  12. 'Close': function(){
  13. $(this).dialog('close');
  14. }
  15. }
  16. });
  17. // register click events
  18. $("#open_new_dialog").click(function(){
  19. $("#second_dialog").dialog('open');
  20. });
  21. $("#second_dialog_link").click(function(){
  22. alert("Second dialog link");
  23. });
  24. // register change events
  25. $("#selection").change(function(){
  26. alert($("#selection :selected").val());
  27. });
  28. });
  29. </script>
  30.  
  31. <a id="open_new_dialog">
  32. Open Second Dialog
  33. </a>
  34.  
  35. <div id="second_dialog">
  36. <a id="second_dialog_link">Click me</a>
  37.  
  38. <select id="selection">
  39. <option value="0">first</option>
  40. <option value="1">second</option>
  41. <option value="2">third</option>
  42. </select>
  43. </div>

Report this snippet  

You need to login to post a comment.