Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. $('#myIframe input').addEvent('focus', function() {
  2. // Do something
  3. });
  4.  
  5. $('myIframe').contentDocument.getElements('input').addEvent(
  6.  
  7. $('myIframe').contentDocument.querySelector('input').addEventListener(
  8.  
  9. var iframe = new IFrame({
  10. src: '/RN95f/3/show',
  11. styles: {
  12. border: '2px solid #ccf'
  13. },
  14. events: {
  15. load: function () {
  16. alert('The iframe has finished loading.');
  17. this.contentDocument.getElements('input').addEvent('focus', function () {
  18. // Do something
  19. alert('focus on input detected!');
  20. console.log(this);
  21. });
  22. }
  23. }
  24. });
  25. $(document.body).adopt(iframe);
  26.  
  27. $('myIframe').onload = function() {
  28. $('myIframe').contentDocument.getElements('input').addEvent('focus', function() {
  29. // Do something
  30. });
  31. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement