Auto-Fade Out after X number of seconds?

23 views
Skip to first unread message

Topix

unread,
Jul 4, 2009, 6:48:45 PM7/4/09
to facebox
Can anyone out there tell me how to get this to work with Facebox?

There is another post on this here:
http://groups.google.com/group/facebox/browse_thread/thread/c59cf9bc71d6a98e/a713bbec72a8ca0b?lnk=gst&q=auto+fade#a713bbec72a8ca0b

but the post has been dead for almost a year with no reply to how he
actually got this to work

he said got this to work by using:

jQuery(document).trigger('close.facebox')

my question is how do we define the "x" number of seconds?

thanks

Jade

unread,
Jul 5, 2009, 3:54:29 AM7/5/09
to facebox
You can use "setTimeout()" to trigger an arbitrary function after x
amount of seconds.

See: http://www.w3schools.com/js/js_timing.asp

So something like ...


setTimeout('$.facebox.close()', 2000);


... would execute $.facebox.close() after 2 seconds.

The close trigger you mentioned is just a way to bind something else
to "Trigger" the close facebox event , which is : $.facebox.close().

So depending on your code, you can do it any number of ways, but I
think the setTimeout function is what you are after.

Hope this helps.

Topix

unread,
Jul 5, 2009, 5:21:44 AM7/5/09
to facebox

thank you Jade!

that works perfectly and is EXACTLY what I was looking for!
Reply all
Reply to author
Forward
0 new messages