Style Screenshots with JavaScript

GrabzIt's JavaScript API allows all generated HTML elements to be styled with CSS.

Style Images

Image screenshots can be styled using the displayid and displayclass parameters. These parameters dynamically add the id or class attribute respectivley, to the image object. Below a CSS class is assigned to the screenshot image.

An additional benefit of using these options also allows you to use JavaScript to manipulate the screenshot image. Below the specified id is assigned to the generated image screenshot and then the specified onfinish function is called once the screenshot is loaded. This function then uses the specified id to get the screenshot image and displays its height.

Style Error Messages

Error messages can be styled using the errorid and errorclass parameters. These parameters dynamically add the id or class attribute respectively to the error message <span> element, while additionally removing the default error style.

Of course if this is used in combination with the onerror event then the error message can also be manipulated with JavaScript. Below a errorid is specified so that the error message span can be referenced in the onerror function. This function then changes the error message if a certain error code is returned.