Library: SimileAjax.Graphics
Overview
Graphics utility functions and constants
Constructors
Functions
SimileAjax.Graphics.createTranslucentImage(url, verticalAlign)
Creates a DOM element for an img tag using the URL given. This is a convenience method that automatically includes the necessary CSS to allow for translucency, even on IE.
parameters
String url the URL to the image
String verticalAlign the CSS value for the image's vertical-align
returns
Element a DOM element containing the img tag
SimileAjax.Graphics.createTranslucentImageHTML(url, verticalAlign)
Creates an HTML string for an img tag using the URL given. This is a convenience method that automatically includes the necessary CSS to allow for translucency, even on IE.
parameters
String url the URL to the image
String verticalAlign the CSS value for the image's vertical-align
returns
String a string containing the img tag
SimileAjax.Graphics.setOpacity(elmt, opacity)
Sets the opacity on the given DOM element.
parameters
Element elmt the DOM element to set the opacity on
Number opacity an integer from 0 to 100 specifying the opacity
SimileAjax.Graphics.createBubbleForPoint(pageX, pageY, contentWidth, contentHeight, orientation)
Creates a nice, rounded bubble popup with the given page coordinates and content dimensions. The bubble will point to the location on the page as described by pageX and pageY. All measurements should be given in pixels.
parameters
Number pageX the x coordinate of the point to point to
Number pageY the y coordinate of the point to point to
Number contentWidth the width of the content box in the bubble
Number contentHeight the height of the content box in the bubble
String orientation a string ("top", "bottom", "left", or "right") that describes the orientation of the arrow on the bubble
returns
Element a DOM element for the newly created bubble
SimileAjax.Graphics.createMessageBubble(doc, an)
Creates a floating, rounded message bubble in the center of the window for displaying modal information, e.g. "Loading..."
parameters
Document doc the root document for the page to render on
Object an object with two properties, contentDiv and containerDiv, consisting of the newly created DOM elements
SimileAjax.Graphics.createAnimation(f, from, to, duration, cont)
Creates an animation for a function, and an interval of values. The word "animation" here is used in the sense of repeatedly calling a function with a current value from within an interval, and a delta value.
parameters
Function f a function to be called every 50 milliseconds throughout the animation duration, of the form f(current, delta), where current is the current value within the range and delta is the current change.
Number from a starting value
Number to an ending value
Number duration the duration of the animation in milliseconds
Function cont an optional function that is called at the end of the animation, i.e. a continuation.
returns
SimileAjax.Graphics._Animation a new animation object
Runs this animation.
Increments this animation by one step, and then continues the animation with run().
SimileAjax.Graphics.createStructuredDataCopyButton(image, width, height, createDataFunction)
Creates a button and textarea for displaying structured data and copying it to the clipboard. The data is dynamically generated by the given createDataFunction parameter.
parameters
String image an image URL to use as the background for the generated box
Number width the width in pixels of the generated box
Number height the height in pixels of the generated box
Function createDataFunction a function that is called with no arguments to generate the structured data
returns
a new DOM element
Objects
Boolean SimileAjax.Graphics.pngIsTranslucent
A boolean value indicating whether PNG translucency is supported on the user's browser or not.
Generated by JsDoc Toolkit on Tue, 07 Aug 2007 20:53:48 GMT