Is there a way to use the Jmol.js library's jmolLink and also employ a
swap image behavior such that the image-based "button" changes
appearance on mouseovers (as well as after having been clicked)?
This functionality does not currently exist in the Jmol.js JavaScript
library.
If someone tells me how the rollover stuff works then I can add it.
Hi Miguel,
Thanks for offering to incorporate this. Here is some example code for a rollover image swap. It may not be the most efficient way to do it but I hope it offers enough information for you.
Additionally, I think there is a way to code it so the mouseover image remains in place when the button is clicked, serving as a visual cue as to which buttons have already been clicked. This is useful in longer tutorials with text interspersed with buttons, but I do not know how to code it. If someone has a suggestion it would be most welcome...
<x-tad-bigger>
<head>
<script language="JavaScript">
<!--
image01= new Image(42,42)
image01.src="test.gif"
image02= new Image(42,42)
image02.src="test2.gif"
function rollover(imagename, newsrc){
document.images[imagename].src=newsrc.src
}
//-->
</script>
</head>
<body>
<a href="#" onmouseover="rollover('example', image02)"
onmouseout="rollover('example', image01)">
<img src="test.gif" border="0" name="example">
</a>
</body>
</x-tad-bigger>
Frieda
*************************************
Frieda S. Reichsman, PhD
Molecules in Motion
Interactive Molecular Structures
http://www.MoleculesInMotion.com
Shutesbury, MA
*************************************

