|
Triggering functions when closing a fancybox pop up |
I needed to have the parent page change when the user had performed an action within the pop up. But how to do this?
FancyBox (http://fancybox.net/) has a 'onClosed' option to allow you to embed a function call whenever the user closes the lightbox.
The format of this is a little tricky, so here is an example:
2$.fancybox({
3 'autoDimensions': false,
4 'speedIn' : 600,
5 'speedOut' : 200,
6 'overlayShow' : true,
7 'width' : 440,
8 'height' : 340,
9 'type' : 'iframe',
10 'scrolling' : 'no',
11 'transitionIn' : 'elastic',
12 'transitionOut' : 'fade',
13 'enableEscapeButton' : 'true',
14 'overlayOpacity' : 0.5,
15 'title' : '',
16 'href' : 'yourpage.htm',
17 'onClosed' : function() { alert('closed'); }
You can build any function you want in this call, it is normal JavaScript after all, if you just wanted to reload the page you could have a refresh function:
2
3parent.location.reload(true);
4
5}
This seems to work for any method of closing the Fancybox as well, so it will always fire.
|
JQuery Drag and Drop to multiple div elements |
This article explains how straight forward the JQuery Drag and Drop interfaces are to use, and how I constructed a Drag and Drop example using multiple divs.
There is an example of a JQuery Drag and Drop demo here. http://www.mccran.co.uk/examples/jquery-drag-drop
|
Book review: CMS Design Using PHP and JQuery |
I was recently approached by Packt Publishing to review one of their new books, CMS Design using PHP and JQuery. They mentioned that I'm always talking about JQuery so thought I'd be an ideal test subject.
I've dabbled in some PHP, and JQuery is an everyday tool in my arsenal so I was more than happy to give it a read.
|
Using the JQuery Tooltip plugin to enhance title attributes |
This article shows how you can use the JQuery tooltip plugin to enhance the title attribute, and how the title tag can be used to convey a more useful message to your browsers.