Re: [jQuery] modalContent Plugin 0.7
you can prevent 'tabbing' using document.activeElement: 1) save it, 2) blur it, 3) focus saved (on exit). p.s. not all browsers support it, so you'll have to 'do it yourself': code $(function(){ if (typeof document.activeElement == 'undefined') { $('a, input, select, textarea, button') .blur(function(){document.activeElement = null;}) .focus(function(){document.activeElement = this;}); } }); /code Gavin M. Roy wrote: I've released the very-quickly incremented modalContent plugin which is now at 0.7. This release fixes bugs, adds animations to the display of the modalContent and an unmodalContent() function which can turn off the modalContent when using ajax or what not. The file size (6.2K) is based upon heavy whitespace and comments. I'm working on a comment-less version to cut down on file size and will offer both on the page. The demo and download is available at http://jquery.glyphix.com Gavin ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ -- View this message in context: http://www.nabble.com/modalContent-Plugin-0.7-tf2735715.html#a7635329 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] modalContent Plugin 0.7
Gavin M. Roy schreef: The file size (6.2K) is based upon heavy whitespace and comments. I'm working on a comment-less version to cut down on file size and will offer both on the page. You could reduce the code by using switch instead of all those if/else statements. for example // Apply our css and positioning, then show if ( animation == 'fade' ) { $('#modalBackdrop').top(wt).css(css).height(winHeight + 'px').width(winWidth + 'px').show(); modalContent.top(mdcTop + 'px').left(mdcLeft + 'px').fadeIn(speed); } else { if ( animation == 'slide' ) { $('#modalBackdrop').top(wt).css(css).height(winHeight + 'px').width(winWidth + 'px').show(); modalContent.hide().top(mdcTop + 'px').left(mdcLeft + 'px').slideDown(speed); } else { if ( animation == 'show') { $('#modalBackdrop').top(wt).css(css).height(winHeight + 'px').width(winWidth + 'px').show(); modalContent.top(mdcTop + 'px').left(mdcLeft + 'px').show(); } } } change to switch(animation){ case 'fade': $('#modalBackdrop').top(wt).css(css).height(winHeight + 'px').width(winWidth + 'px').show(); modalContent.top(mdcTop + 'px').left(mdcLeft + 'px').fadeIn(speed); break; case 'slide': $('#modalBackdrop').top(wt).css(css).height(winHeight + 'px').width(winWidth + 'px').show(); modalContent.hide().top(mdcTop + 'px').left(mdcLeft + 'px').slideDown(speed); break; case 'show': $('#modalBackdrop').top(wt).css(css).height(winHeight + 'px').width(winWidth + 'px').show(); modalContent.top(mdcTop + 'px').left(mdcLeft + 'px').show(); break; } It also makes the code easier to read and manipulate ;) -- David Duymelinck [EMAIL PROTECTED] ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] modalContent Plugin 0.7
You could reduce the code by using switch And by eliminating duplicate code: $('#modalBackdrop').top(wt).css(css).height(winHeight + 'px').width(winWidth + 'px').show(); modalContent.top(mdcTop + 'px').left(mdcLeft + 'px'); switch(animation){ case 'fade': modalContent.fadeIn(speed); break; case 'slide': modalContent.hide().slideDown(speed); break; case 'show': modalContent.show(); break; } ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] modalContent Plugin 0.7
If you had the user define the animation effect in terms of the actual jQuery method names (fadeIn, slideDown, show) and made the default be show, you could replace all of that with one line: modalContent.css({top: mdcTop+'px', left: mdcLeft+px}).hide()[animation](speed); Nice, Dave! And nice plugin, Gavin. I like how easy it is to use. Mike ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] modalContent Plugin 0.7
Other navigation keys need to be handled too (Home, Page Up, space bar, etc). Currently, they can be used to get around the modality of the dialog and access content that is not masked. If changing the focus is handled, can you extend the mask to the entire window instead of just the viewport? zaadjis wrote: you can prevent 'tabbing' using document.activeElement: ... Gavin M. Roy wrote: The demo and download is available at http://jquery.glyphix.com -- View this message in context: http://www.nabble.com/modalContent-Plugin-0.7-tf2735715.html#a7646073 Sent from the JQuery mailing list archive at Nabble.com. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] modalContent Plugin 0.7
Your demo doesn't work in IE6 - the grey background and window were added below the content instead of layered on each other. Blair On 12/1/06, Gavin M. Roy [EMAIL PROTECTED] wrote: I've released the very-quickly incremented modalContent plugin which is now at 0.7. This release fixes bugs, adds animations to the display of the modalContent and an unmodalContent() function which can turn off the modalContent when using ajax or what not. The file size (6.2K) is based upon heavy whitespace and comments. I'm working on a comment-less version to cut down on file size and will offer both on the page. The demo and download is available at http://jquery.glyphix.com Gavin ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] modalContent Plugin 0.7
Thanks, I've updated the code and released 0.9. It addresses the MSIE issues. On 11/30/06, Blair McKenzie [EMAIL PROTECTED] wrote: Your demo doesn't work in IE6 - the grey background and window were added below the content instead of layered on each other. Blair On 12/1/06, Gavin M. Roy [EMAIL PROTECTED] wrote: I've released the very-quickly incremented modalContent plugin which is now at 0.7. This release fixes bugs, adds animations to the display of the modalContent and an unmodalContent() function which can turn off the modalContent when using ajax or what not. The file size (6.2K) is based upon heavy whitespace and comments. I'm working on a comment-less version to cut down on file size and will offer both on the page. The demo and download is available at http://jquery.glyphix.com Gavin ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] modalContent Plugin 0.7
Now I'm getting Error: Expected identifier, string or number on line 1 during page load. When I continue and try to use the links I get Object doesn't support this property or method on line 15. On 12/1/06, Gavin M. Roy [EMAIL PROTECTED] wrote: Thanks, I've updated the code and released 0.9. It addresses the MSIE issues. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] modalContent Plugin 0.7
Sorry, left something in I meant to take out. Please retest. On 11/30/06, Blair McKenzie [EMAIL PROTECTED] wrote: Now I'm getting Error: Expected identifier, string or number on line 1 during page load. When I continue and try to use the links I get Object doesn't support this property or method on line 15. On 12/1/06, Gavin M. Roy [EMAIL PROTECTED] wrote: Thanks, I've updated the code and released 0.9. It addresses the MSIE issues. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] modalContent Plugin 0.7
Excellent. :) On 12/1/06, Gavin M. Roy [EMAIL PROTECTED] wrote: Sorry, left something in I meant to take out. Please retest. ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] modalContent Plugin 0.7
Can I control the size of the window? Is it possible to bind an event to close? Can one close from within JS instead of with an a.close element? On 12/1/06, Blair McKenzie [EMAIL PROTECTED] wrote: Excellent. :) ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] modalContent Plugin 0.7
Yes, the inner content is controlled by your css outside of the plugin. You can close it via $(document).unmodalContent(); in addition to adding the class close to anything you want the user to click that handles a click event. Im not sure how to handle an event binding, but you could do something like $('#blah').blur(function(){$(this).unmodalContent();); On 11/30/06, Blair McKenzie [EMAIL PROTECTED] wrote: Can I control the size of the window? Is it possible to bind an event to close? Can one close from within JS instead of with an a.close element? On 12/1/06, Blair McKenzie [EMAIL PROTECTED] wrote: Excellent. :) ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] modalContent Plugin 0.7
Gavin M. Roy wrote: I've released the very-quickly incremented modalContent plugin which is now at 0.7. This release fixes bugs, adds animations to the display of the modalContent and an unmodalContent() function which can turn off the modalContent when using ajax or what not. The demo and download is available at http://jquery.glyphix.com Gavin, I'm pleased to see that you aren't breaking any existing binds when displaying inline content. This is exciting :) Good work!\ I'll be adapting this as soon as I get in the mood to do some graphic/CSS dialog styling ;) ~ Brice ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] modalContent Plugin 0.7
Blair McKenzie wrote: Can I control the size of the window? Is it possible to bind an event to close? Can one close from within JS instead of with an a.close element? It would also be nice to bind a custom function to open -- this way if you call the .modalContent() on an empty (yet styled) div, you'll be able to inject its content via $.load(). Any ideas? ~ Brice ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/