[ 2 posts ]

hame25

  • Joined: Thu Apr 26, 2012 5:34 am
  • Posts: 35
  • Offline
  • Profile
Tags:

Overlay focus

Post Posted: Fri Jul 27, 2012 7:04 am
+0-
Hi

I am using the overlay widget and wondered if there is an inbuilt method to give the contents of the overlay focus once it is shown.

Also is there a function that passes focus back to the initiating element when the overlay is closed?

Thanks in advance

Juan Ignacio Dopazo

YUI Contributor

  • Username: jdopazo
  • Joined: Fri Oct 02, 2009 5:39 am
  • Posts: 620
  • Location: Buenos Aires, Argentina
  • Twitter: juandopazo
  • GitHub: juandopazo
  • Gists: juandopazo
  • Offline
  • Profile
Tags:

Re: Overlay focus

Post Posted: Fri Jul 27, 2012 7:39 am
+0-
You can use the visibleChange event of the overlay:
Code:
overlay.after('visibleChange', function (e) {
  if (e.newVal) {
    overlayContent.focus();
  } else {
    initiatingElement.focus();
  }
});
  [ 2 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum