Enhancements to subModal

I started hacking around with subModal (modal javascript windows with background shading) this morning to add some features I liked in Lightbox Gone Wild. You can try it out and download my changes to subModal here. They are:

  1. Convert an href into a modal window just by setting its class=”submodal”. Now you can do
    <a href="foo.html" class="submodal">foo</a>

    and when you click the link the contents will show up in a modal window. Previously submodal required specifying onclick functions and duplicating the target URL.

  2. You no longer need to put special div containers in each individual page, subModal.js now adds them to the DOM for you.
  3. I fixed a bug in Opera where one of the subModal functions that gets triggered on page load was called infintely.
  4. Moved all the javascript into subModal.js and removed common.js
  5. Safari active scrollbar fix suggested by Thomas Risberg in a comment on this post.

Here is the file with my changes: subModal.zip.

This entry was posted in Design, Javascript, Web. Bookmark the permalink.

31 Responses to Enhancements to subModal