Styled alert box without a JS library - javascript

I would like to display an alert on my web site.
I could use a library like jQuery, but currently, the site does not use one, and I don't think it is a good idea to add a library just for the sole purpose of an alert box.
Is there any way of styling the alert box, or is there a pure js alternative to something like jQuery modal dialog?

Is there any way of styling the alert box
No, it is browser chrome and you can't touch it.
or is there a pure js alternative to something like jQuery modal dialog?
jQuery doesn't have a modal dialog. jQuery UI does.
There is no pure JS alternative — you are dealing in presentation, so you need CSS.
jQuery UI is pure JS + CSS, and anything you can do with it, you can do by writing the JS and CSS yourself. Look at their code if you want an example.

Related

Where can I find simple and small Javascript lightbox plugins or tutorials?

Does anyone know of a plugin or tutorial for making a simple lightbox to display a simple HTML form?
Hmm the title says dialog, but the question says lightbox.
For a dialog, you can use jQuery Dialog.
For a lightbox, you can use FancyBox
I like Shadowbox. It's a jQuery plugin, so you have to be running jQuery; but it can display just about anything you want it to: HTML, videos, images, whatever. If you're moderately HTML/CSS savvy, it's easy to install, use, and style.
It also allows you to download versions...that do whatever you want it to. So if you only want it to display HTML, you're good. Just download that bit, et voila.

jquery modal / dialog

I want to use some jquery plugin to show modal. I have been using fancybox but it has problem that second fancybox can not be shown on one. I have used jquery UI but it has images and I want some plugin which is not dependent on images. Here are my requirements:
to show on page load
to show on ajax success
customizable with custom css
second modal/dialog can be shown on first one.
Please suggest.
I like http://jqueryui.com/dialog/ I know you said that you used it but did not like it as it has images, but I would override your images with custom css - which is not to difficult. simnple model is fine but I find ui better
Your question is not in the Q&A format of Stackoverflow, because you are essentially soliciting opinions (i.e., no definitive answer).
Nevertheless, SimpleModal is an excellent light-weight jQuery plugin I've used for modal dialog boxes.
Have a look on this one, I used it in the past: http://www.paulund.co.uk/how-to-create-a-simple-modal-box-with-jquery

Is there a basic/simple lightbox/overlay jQuery-based library anywhere?

Is there any Lightbox-live or overlay library out there that only provides the "basic cross-browser centered popup with a dark background" without attempting to perform requests and display images?
I would like to populate the contents myself using my own JS code which is non-trivial and all of these libraries expecting a link with something displayable inside it are unusable for my simple yet unusual (it would appear) use case...
I've gone over maybe 15 Lightbox clones today and for the life of me couldn't find a simple way to just get the basic overlay functionality without the added fluff. Is anyone familiar with something like that ?
Look into Colorbox. Check the Inline Examples. It works well.
http://jacklmoore.com/colorbox/
Look here: http://jacklmoore.com/colorbox/example1/ under "Other Content types"
Try jQuery UI dialog!
jQuery Dialog in jQuery UI might be an option to consider.
You can customize the download of the library to give you only the dialog.
Just de-select everything from here and select "Dialog" only (it will select the minimum dependencies for you):
http://jqueryui.com/download

Do Auto complete plug-in for jquery comes with out css

Is their any jQuery plug-in for auto complete that allows our own styling?
Every library i see comes with a built in cascading style sheet.
Yes and no.
At http://jqueryui.com/download you can select "no theme", but you will still get an .css that you need to use. That css is used in the javascript code to open, close and interact with the autocomplete menu and text.
It is pretty easy to alter the .css to make it look like you want it to. Try some small changes and reload the page to see what happens!
I don't have a perfect script for you, but you can download the Jquery-ui library with the "No Theme" option.
In fact, there is a minimalist default theme, but you can easily override it in order to build your own theme.
jQuery UI Does indeed allows user-based styling. You can simply change the css file as if you'd do from scratch. Heck, just write down the class names and create your own...

Javascript lightbox component that works with arbitrary HTML

Is there a Javascript component that allows me to simply pass it a string made up of arbitrary HTML (any HTML I wish to use) and will show that HTML in a lightbox?
I've been scouring the internet, searching for examples, but it seems like there simply isn't any component capable of doing this.
Even LightWindow, which claims to be all-purpose, still requires me to attach it to an tag with the href set to an element ID.
This isn't what I want. I want to be able to call a function and pass in the HTML myself.
(Another issue with LightWindow is that it requires scriptaculous as a dependency. The project already uses jQuery, and I'd rather not include two frameworks at once.)
Any ideas?
colorbox is great. It relies on JQuery.
To use it with an html string, you would call it like this:
$.colorbox({html:'<p>Hello</p>'});
You can use jqModal or jQuery UI dialog.
SLaks is correct. You should definitly use JQuery UI dialog. Here is an example of using the JQuery dialog as a modal, very similar to using lightbox.
$("#dialog-message").dialog({modal: true});

Categories

Resources