Hmm...
Well I tried making my own button using the code you sent and I think it
should work but it doesn't.
The 'jmolScript' function is behaving funkily. If I do:
<script> jmolScript("select *; color green; spacefill 2.0") </script>
It doesn't do anything at all. If I precede the jmolscript with an 'alert'
function then the alert window appears and immediately I see my molecule
highlighted in green. If I put the 'alert' function AFTER the jmolscript
function then nothing happens. No alert window, no green highlighting.
Any idea what I'm doing wrong?
Sam
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Rolf
Huehne
Sent: Friday, June 24, 2005 12:49 PM
To: [email protected]
Cc: 'Samuel Flores'
Subject: Re: [Jmol-developers] making custom jmolButton function
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=ick
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers
-------------------------------------------------------
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