Skip to content
A simple and quick way to create modal windows using the prototype framework
JavaScript
Find file
Failed to load latest commit information.
lib
src
test
.gitignore
README.textile Corrected an extremely stupid mistake in the ReadMe file Apr 1, 2009

README.textile

What’s this?

A plugin that allows you to create modal windows on the fly. You can put text, forms, images, iframes or any other HTML element in it. It can be made to make a rest of the screen inactive or just be placed like a normal window.

Installation/Usage

modal-window-prototype includes Prototype Javascript framework. New versions can be obtained from the links provided below.

To use include all the files lib folder and the src folder.

To load modal.js, add the following to the HEAD of your page or optionally to the end of the BODY to increase efficiency and loading time -

  <script src="/javascripts/prototype.js" type="text/javascript"></script>
  <script src="/javascripts/modal.js" type="text/javascript"></script>

To create a new modal window you’ll need to create an instance of the class and pass the element to the show() method to display it in the modal window.

  pop = new ModalWindow();
  myElem = new Element('div').update("Hello")'
  pop.show(myElem, true);

The boolean value passed to the function is to show the overlay that’ll hide the rest of the window. Set it to false to make the window appear normally.

The Distribution

All the files related to modal-window-prototype are in the src folder. The files that its dependent on is in the lib folder.

To get started and see the basic usage see the test folder. It has examples and usage of the different options provided by modal-window-prototype.

License

Modal Window for Prototype, “modal-window-prototype” is licensed under the terms of the MIT license.

  Copyright (c) 2009 Prateek Saxena

  Permission is hereby granted, free of charge, to any person
  obtaining a copy of this software and associated documentation
  files (modal-window-prototype), to deal in modal-window-prototype
  without restriction, including without limitation the rights to use,
  copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of it, and to permit persons to whom it
  is furnished to do so, subject to the following
  conditions:

  The above copyright notice and this permission notice shall be
  included in all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  OTHER DEALINGS IN THE SOFTWARE.

Dependencies

  1. Prototype
Something went wrong with that request. Please try again.