I agree. :o)

On Thu, Aug 28, 2008 at 10:51 AM, Fontzter <[EMAIL PROTECTED]> wrote:

>
> That makes me think that it would be nice if we could have a more
> organized repository for code snippets.  I know the plugins handle a
> lot of this; but there are always little things like this that would
> be handy.  It would be nice if there were a place to store, browse and
> search through code snippets that do various little things like this.
>
> On Aug 27, 4:03 pm, "Chris Jordan" <[EMAIL PROTECTED]> wrote:
> > lol! I wrote one of those a while back and posted it to the group too...
> > small world. :o)
> >
> > Chris
> >
> >
> >
> > On Wed, Aug 27, 2008 at 1:35 PM, Fontzter <[EMAIL PROTECTED]> wrote:
> >
> > > Thanks Richard.  I threw this into a function if anyone is interested:
> >
> > > function prettyAlert(p_message, p_title)
> > > {
> > >  p_title = p_title || "";
> > >  $("<div>" + p_message + "</div>").dialog({
> > >    title: p_title,
> > >    resizable: false,
> > >     modal : true,
> > >    overlay: { backgroundColor: "#000", opacity: 0.5 },
> > >     buttons: { "Okay": function() { $(this).dialog("close"); } },
> > >     close: function(ev, ui) { $(this).remove(); }
> > >   });
> > > }
> >
> > > On Aug 27, 11:57 am, "Richard D. Worth" <[EMAIL PROTECTED]> wrote:
> > > > Yes, provide a close callback in the options, like so:
> >
> > > > $('<div>jQuery is great!</div>').dialog({
> > > >   ...
> > > >   close: function(ev, ui) {
> > > >     $(this).remove();
> > > >   }
> > > >   ...
> > > >   });
> >
> > > > The 'this' is the dialog content element, the same on which you
> called
> > > > .dialog(). When you .remove() it, it will destroy the dialog.
> >
> > > > - Richard
> >
> > > > On Wed, Aug 27, 2008 at 11:42 AM, Fontzter <[EMAIL PROTECTED]>
> wrote:
> >
> > > > > Hi,
> >
> > > > > I want to emulate a custom alert message using the dialog.  Here's
> an
> > > > > example:
> >
> > > > >          $('<div>jQuery is great!</div>').dialog({
> > > > >            title: "I love jQuery",
> > > > >            modal : true,
> > > > >            overlay: {
> > > > >              backgroundColor: '#000',
> > > > >              opacity: 0.5
> > > > >            },
> > > > >            buttons: {
> > > > >              'Okay': function() {
> > > > >                $(this).dialog('close').remove();
> > > > >                return false;
> > > > >              }
> > > > >            }
> > > > >          });
> > > > >        }
> >
> > > > > One thing I realized though, is that if the user clicks the X
> rather
> > > > > than a button, the dialog gets closed but not removed.  Is there a
> way
> > > > > to not show the X or to destroy the dialog when it is closed via
> the
> > > > > X?  I guess I could add a close function to the options; but I
> wasn't
> > > > > sure exactly what the function would look like to get the dialog
> > > > > element.  Also, I was wondering if there was a better way to do
> this
> > > > > that I am not seeing.
> >
> > > > > Thanks,
> >
> > > > > Dave
> >
> > --http://cjordan.us
> >
>


-- 
http://cjordan.us

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to