Alex, you can't use the ready function to send scripts to the applet -- 3
seconds or whatever. The ready function can fire well before the applet is
loaded.

NOT:

        $(document).ready(function(){

            setTimeout(function(){
                var klick = '\n' +
                    'function klick(){\n' +
                        'isosurface display within 5.0 ({atomIndex =
_atomPicked});\n' +
                        'center {atomIndex = _atomPicked};\n' +
                    '}\n' +
                    'set PickCallback "jmolscript:klick();";';

                //jmolScriptWait('center {atomIndex = 1}; zoom 600;
isosurface sigma 1 "../data/iso/test.ccp4" mesh nofill; isosurface
display within 5.0 ({atomIndex = 1}); ' + klick, '0');
                jmolScriptWait('center {atomIndex = 1}; zoom 600;
isosurface "../data/iso/test_sigma_1.0.jvxl" mesh nofill; isosurface
display within 5.0 ({atomIndex = 1}); ' + klick);

            }, 3000);



        });


INSTEAD, just put the script into the JmolApplet call:


                var klick = '\n' +
                    'function klick(){\n' +
                        'isosurface display within 5.0 ({atomIndex =
_atomPicked});\n' +
                        'center {atomIndex = _atomPicked};\n' +
                    '}\n' +
                    'set PickCallback "jmolscript:klick();";';


        jmolApplet(["300","300"], 'load ../data/iso/test.pdb;center
{atomIndex = 1}; zoom 600; isosurface
"../data/iso/test_sigma_1.0.jvxl" mesh nofill; isosurface display
within 5.0 ({atomIndex = 1}); ' + klick);
        });



That's what is crashing the applet/browser.


On Mon, Aug 16, 2010 at 11:14 AM, Alexander Rose <
[email protected]> wrote:

> Hi,
>
> ----- Ursprüngliche Mail -----
> > Von: "Robert Hanson" <[email protected]>
> > An: [email protected]
> > Gesendet: Dienstag, 10. August 2010 14:48:50
> > Betreff: Re: [Jmol-users] change the visible part of an isosurface
> without reloading
> > On Tue, Aug 10, 2010 at 7:33 AM, Alexander Rose <
> > [email protected] > wrote:
> >
> > It's certainly an interesting idea, though. Sort of a "hide selected
> > triangles" option, I think. Hmm. We have:
> >
> > isosurface ID "foo" show
> > isosurface ID "foo" hide
> >
> > maybe
> >
> > isosurface ID "foo" show within 2.0 {atomset}
> > isosurface ID "foo" show all
> >
>
> thanks for implementing it as 'isosurface display within 2.0 {atomset}'
>
> Example: http://weirdbyte.de/jmol-test/html/jvxl_vs_ccp4_speed.html
>
> One minor thing: When changing the display params via a jmolscript
> PickCallback (see below), I get a loading indicator which stays until a
> mouseclick. However it works. (Tested on Linux/Firefox, Mac/Firefox/Safari)
>
>
> Alex
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>



-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to