Raster

Static object containing core functions and constants used by the Raster library. Most functions are helpers for javascript and DOM low-level programming.

The following example show the minimal code needed to start working with Raster:
<!DOCTYPE HTML ...>
<html>
<head>
<title>App Title</title>

<link rel="stylesheet"
            href="../raster/themes/modern/raster.css">

<!-- Remove this line is no IE6 support is needed -->
<!--[if lte IE 6]>
<link rel="stylesheet"
      href="../raster/themes/modern/raster-ie6.css"><![endif]-->

<script src="../raster/scripts/min/raster-min-v1.2.js"
        type="text/javascript"></script>

<script type="text/javascript">

///////////////////////////////////////
// Called on onload
//
function main()
{
    Raster.config("../raster");

    // Add code here...
}
 
</script>
</head>
<body>
    <!-- add markup here... -->
</body>
</html>
The key elements in the code above are:
  • Line 6: Link to the "raster.css" stylesheet. In this example, the "modern" theme is used. Line 10 uses conditional comments to load the IE6 support stylesheet "raster-ie6.css". You can ignore this stylesheet is no support for IE6 is needed.
  • Line 14: Loads the Raster javascript library "raster-min-v1.2.js".
  • Line 22: Declares the function main(). The main() method is optional. If present, Raster will call it after the page finishes loading. This is where you will put your page's initialization code.
  • Line 24: Tell Raster where the /raster folder is in relation to the document. Some library methods that dynamically generate html will need this informaton to generate the correct url to css backgrounds, and/or library images. In this example the /raster folder is one directory above where the document is: "../raster".

See Also

Home Examples Download License
 
Copyright © 2010-2017 Edwin R. López