Samuel Flores wrote:

Howdy All,

I’m trying to make a button that will successively highlight different residues on the protein. It will initially highlight, say, residue 10 but when clicked again will highlight residue 11, and then 12 and so on.

I think the way to go is to have some global variable ‘resnum’ which gets incremented every time the button is pressed. Then this resnum variable would be included in the script that is executed, to indictate which residues need to be highlighted. I implemented this as follows below. However, the button does not change anything after repeated clicks. In fact, I can’t get it to do anything differently by modifying the ‘script’ variable inside the onClick event. Is it possible to do things this way? I’m trying to avoid the strategy reloading the whole web page with new parameters..

> This is the page I’m working on:
>
> http://dev.molmovdb.org/cgi-bin/jmol.cgi?mid_=va1a1tA-1f6uA
>
> The button I referred to is labeled ‘Testing’.

Any advice on how to do this?


I would suggest just to define the HTML code of the button by yourself and use the 'jmolScript()' function to submit your (modified) script:

<script>var resnum=10 /* initial value */</script>
<input type="button" value="testing" onClick='jmolScript("select *;color white;spacefill off;wireframe off;select 21,22*;"+"select "+resnum+"*;"+"color green;spacefill 2.0"); resnum++'>

Rolf


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to