How to Skin a CSS Registration Overlay With Javascript

Overlay windows provide you with asynchronous popup windows that don't require you to refresh the window or open a new browser window, which is intrusive for the reader. You use the JavaScript language to dynamically set the CSS skin for the overlay, which is set up in an HTML div container. The class property sets the overlay layout, and this property automatically changes the fonts, colors and size for the overlay.

Instructions

    • 1

      Open your preferred JavaScript or HTML editor. Open the HTML page that contains the popup and the div container you want to edit.

    • 2

      Locate the div container to retrieve the name for the container. For instance, the following code names the container "mycontainer":

      <div id="mycontainer"> </div>

      You need this ID value for your JavaScript code.

    • 3

      Create the JavaScript code to change the overlay window's CSS class. The following code changes the class to "purple":

      document.getElementById("mycontainer").setAttribute("class", "purple");

      Change the class value to your own.

Related Searches:

References

Comments

Related Ads

Featured