code_junkie

jQuery Thickbox or similar to show iFrame?

Nov 11th, 2011
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. <a href="">Open window in Modal Dialog</a>
  2.  
  3. <div id="myContent">
  4. <h1>Look at me!</h1>
  5. <iframe src="http://www.google.com" />
  6. </div>
  7.  
  8. <div class="jqmWindow" id="modalDialog">
  9. <iframe frameborder="0" id="jqmContent" src="">
  10. </iframe>
  11. </div>
  12.  
  13. function showModal(url, height, width)
  14. {
  15. var dialog = $('#modalDialog')
  16. .jqm({
  17. onShow: function(h) {
  18. var $modal = $(h.w);
  19. var $modalContent = $("iframe", $modal);
  20. $modalContent.html('').attr('src', url);
  21. if (height > 0) $modal.height(height);
  22. if (width > 0) $modal.width(width);
  23. h.w.show();
  24. }
  25. }).jqmShow();
  26. }
  27.  
  28. function closeModal(postback)
  29. {
  30. $('#modalDialog').jqmHide();
  31. }
  32.  
  33. wrap.bind('dragstart', function() { overlay.show(); })
  34. .bind('dragstop', function() { overlay.hide(); })
  35. .bind('resizestart', function() { overlay.show(); })
  36. .bind('resizestop', function() { overlay.hide(); });
Add Comment
Please, Sign In to add comment