When Jmol.js is implemented in a very small project -- a simple static page or simple return from a php server, it works great. But more and more (we are seeing), people are using Jmol.js in more sophisticated projects. One reason I rarely use Jmol.js is that all my recent projects have been large, and Jmol has only been a part of a much larger whole.

The questions will come to this list --

How do I turn these checkboxes on and off selectively?
How do I place multiple applet on a page using CSS?
How do I make sure the forms reset?

More and more these answers will require specific targeting of specific elements or applets either using document.getElementById() or document.ELEMENTNAME. It will be far easier in the long run if the examples themselves said, for example:

<form name="jmolform">
<script language="javascript">
      jmolInitialize("../jmol",0)
      jmolApplet(200, "load ../jmol/caffeine.xyz","Model");
      jmolRadioGroup([
          ["spacefill off",  "off"],
          ["spacefill 20%",  "20%", "checked"],
          ["spacefill 100%", "100%"]
        ]," ","Radios");
</script>
</form>

Being a bit more explicit in this sense allows us to talk about document.jmolform.reset() explicitly and to the CSS id #jmolAppletModel{} directly. The object document.jmolform.Radios now refers to the radio set.


David Leader wrote:

 However you only need
to give ids to divs if you are going to manipulate them yourself with Javascript, which is not what we the jmol javascript page is about.

Most useful is the use of id="whatever" for divs, tables, and other page elements so that you can refer to them in CSS style blocks as

#whatever{}

independently of their class.

Miguel has done a great job in Jmol.js, especially for someone not steeped in CSS and JavaScript himself. As Jmol gets more imbedded in larger projects, though, the pressure will be to extend Jmol.js to make it more flexible. I've suggested changes that allow it to be used in dynamic page creation -- routines that end with "return xxx", not just "document.write()" -- as was needed for the Jmol documentation pages.

I happen to think that any form element Jmol.js writes to the page should have an id, a class, and a name so that CSS can refer to it directly, CSS can refer to it as a class, and JavaScript can refer to it as a named object.

This simple addition would go a long way to making the applet more generally 
useful.

Bob

--
Robert M. Hanson, [EMAIL PROTECTED], 507-646-3107
Professor of Chemistry, St. Olaf College 1520 St. Olaf Ave., Northfield, MN 
55057
mailto:[EMAIL PROTECTED] http://www.stolaf.edu/people/hansonr



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to