Eric, while I haven't had need for these, here's the scoop just looking at 
Jmol.js:

the functions

jmolSetAppletCssClass(appletCssClass)
jmolSetButtonCssClass(buttonCssClass)
jmolSetCheckboxCssClass(checkboxCssClass)

etc.

just assign whatever "classname" you want to give these elements. These are just
names you reference in a <style></style> element at the head of your HTML.
So, for example, say you want the applet to be positioned at (top,left)=(100,200) on the page. You could just have

<style>
.applet{position:absolute;top:100;left:200}
</style>

then somewhere BEFORE calling jmolApplet() but AFTER jmolInitialize() you could 
call

jmolSetAppletCssClass("applet")

Then, when jmolApplet() is called, this will then write a "class=applet" parameter into the applet tag, which assigns any styles associated with the applet to those listed under ".applet" in the style element.

Frankly, it's probably not that useful, because it's not usually that helpful to
put something in a specific place on the page on its own. What's far more useful is to place the applet in a table in a div and then define the position of the DIV instead of the applet. So I would do something like this:

<style>
.appletdiv{position:absolute;top:100;left:200;width:500;height:500;overflow:auto}
</style>

<div class=appletdiv>
<table>
<tr><td> stuff on the left</td>
<td><script language=javascript>jmolApplet(...)</script>
</td>
</table>
</div>

What the style does is allow you to have the applet in a box with text on the left (in this case), right -- wherever -- and if the text overflows, then you will see a nice scrollbar there the user can use.

In short: The table gives you relative positioning of the applet with what's around it. Adding width=xxx to the table also can prevent overflow to the right. The div gives you absolute positioning as well as overflow control. The style gives you quick control over exact positioning, fonts, borders, all the fancy stuff.

It's the combination -- applet in table in div -- that makes it all work. And the real fun comes when you realize that you can put a div in a div in a div. Each piece does its own specific part of the task. So the idea of the Jmol.js css functions, though noble, is probably not all that useful, really. Not in general, anyway.


Bob Hanson

Eric Martz wrote:

OK, I am advised to align jmol right (to allow buttons and text to wrap around it) using div and CSS (cascading style sheets). And I note that jmol.js also has support for CSS. But I have no experience with CSS. I have looked around but not seen any jmol examples using CSS. Can someone point me to a simple example that uses CSS to align jmol left or right, and uses some of the jmol.js CSS capabilities?

Thanks -Eric

----
Eric Martz, Professor Emeritus, Dept Microbiology
University of Massachusetts, Amherst MA US
http://www.umass.edu/molvis/martz



-------------------------------------------------------
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

--

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

"Imagination is more important than knowledge."  - Albert Einstein


-------------------------------------------------------
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