Scarlet Line home page Scarlet Line - SOFTWARE DESIGN & DEVELOPMENT

[Home]->[Documentation]->[Molecular Viewer]->[User's Guide]->[Examples]->[Scripting]

Expand All
Collapse All

Molecular Viewer Scripting Examples Locate in Contents

Here is the html that is used to embed the above molecule:

<object id="molview1" type="chemical/x-xyz" width="400" height="300" >
    <param name="caption" value="water"/>
    <param name="skyground" value="false"/>
    <param name="bgcolour" value="green"/>
    <param name="inline" value="3&#xA;
O  4.013   0.831  -9.083&#xA;
H  4.941   0.844  -8.837&#xA;
H  3.750  -0.068  -9.293&#xA;

Background Colour Changing Locate in Contents

Click on the buttons to change the background colour:

Here is the html and javascript used to implement the buttons:

<script type="text/javascript">
   function button_bgcolour(new_colour)
      var molview1 = document.getElementById('molview1');
      molview1.bgcolor = new_colour;
   <input type="button" value="red" onclick='button_bgcolour(this.value)' />
   <input type="button" value="aqua" onclick='button_bgcolour(this.value)' />
   <input type="button" value="#F0F0F0" onclick='button_bgcolour(this.value)' />