Hi Geoff, I'm a big fan of JSmol in iframes. The isolation has advantages.
One thing that you might want to think about is to include an "editor" JSmol in a position:fixed hidden div. This "editor" can be made large enough that the pop up fits. You would not have to go any larger than that needed for a pop up click in the upper left hand corner of the window. Within the same domain, cross communication between embedded JSmol objects is possible. If both objects are in iframes the syntax could get dicey, however. The basic idea is that clicking something (atom, button, link, double-click on window) in an embedded small model would bring up the pop-up with the model ready for action. Closing the big guy could send the model back to the little guy (Jmol state or molfile exchange). To see this type of set-up check: http://chemagic.com/vmknotebook.htm FireFox will not load JSmol properly in a hidden div, but there are some work arounds. If you go this route, drop me a note, and I'll send you details. At the risk of becoming a bore on the subject (little smiley face with a wink here, I never learned how to type them properly), HTML5 Local Storage opens all manner of new options for cross iframe communication without dicey syntax. The above page makes heavy use of Local Storage. All the code is in the page, so aforementioned FF trick is in there, along with CSS tricks to position the "editor." Assuring a centered fixed div is tricky. See #vmk in style sheet for the method. Otis -- Otis Rothenberger [email protected] http://chemagic.com > On Nov 10, 2014, at 8:36 AM, Geoffrey Rowland <[email protected]> wrote: > > Hi folks > > In some situations, it can be really useful to embed a JSmol instance in an > inline frame. Particularly when using JSmol with, say, CMS systems that use > JavaScript libraries that conflict with JSmol. Note that this use-case does > not involve cross-domain issues. Just using an iframe to 'insulate' JSmol > from JavaScript on the parent page. > > However, although an iframe can be easily sized to a JSmol instance, it can > restrict the visibility of the right-click popup JSmol menu. Of course, the > menu can, to some extnt, be dragged around and an iframe can be set up to use > scrollbars for larger content, but this is not very elegant and can be > unwieldy to use. > > This is not a issue with the Jmol Java applet as the right-click menu > 'floats' over the iframe. > > Anyone have any 'cunning' suggestions on how to improve this for JSmol in an > iframe? - apart from just using a bigger iframe! Perhaps a way of dynamically > resizing the iframe to accommodate the popup menu. > > Cheers > > Geoff > ------------------------------------------------------------------------------ > _______________________________________________ > Jmol-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/jmol-users ------------------------------------------------------------------------------ _______________________________________________ Jmol-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jmol-users

