From: Mitch S. <mit...@be...> - 2010-07-01 15:13:18
|
Hmmm, I hadn't thought about this kind of usage. When JBrowse starts up, it puts some UI elements on the screen, and it measures how big those are (because some of the layout JBrowse does can't be done, as far as I know, in pure CSS; the JBrowse javascript calculates the positions/sizes of some of the JBrowse UI elements itself). But if those UI elements aren't displayed, then I would imagine that the results of the size measurements would be wrong, or undefined, or somehow not what JBrowse expects. I'm speculating; it would be easier to diagnose if you could send me a URL so that I could see what's going on myself. But, assuming that I'm guessing correctly about what the problem is, then I think the solution is to run the Browser constructor only after the "GenomeBrowser" element has been displayed. Specifically, somewhere in the page you presumably currently have something like this: var b = new Browser({ containerID: "GenomeBrowser", refSeqs: refSeqs, trackData: trackInfo, defaultTracks: "DNA,gene,mRNA,noncodingRNA", location: queryParams.loc, tracks: queryParams.tracks, bookmark: bookmarkCallback }); What you can do is remove that "new Browser" call from its current location on the page, and put in into the onclick handler instead, after you set style.display='block'. I'm not sure what would happen if the JBrowse element is displayed, then hidden, then displayed again; you might have to remove the element from the page entirely and then recreate it when you want it to be shown again. In other words, bad things will probably happen if you run the Browser constructor more than once with the same element as the container, but you should be safe if you remove and recreate that element before you run the Browser constructor again. Hope this helps, Mitch On 07/01/2010 07:44 AM, Philippe Bardou wrote: > Hi all, > > I'm trying to include jbrowse in our "rich" web application. > To do that, I need to "display:none" the jbrowse div but some display bugs appear ? > > At start I thought that my problem cames from conflict with jquery but finaly not. > > <body> > <span onclick="if(document.getElementById('GenomeBrowser').style.display=='none') {document.getElementById('GenomeBrowser').style.display='block';} else {document.getElementById('GenomeBrowser').style.display='none';}"> > Click Me > </span> > > <div id="GenomeBrowser" style="display: none; height: 100%; width: 100%; padding: 0; border: 0;"></div> > </body> > > If I start without "display: none;" all works fine but it is not what I need... > > Hope I'm clear... ? > > Thanks for your reply > > Philippe > > PS : Thanks a lot Andrew and Mich for your previous replies...! > >> Philippe, >> We ran into a similar issue as we are using jQuery in our >> application as well as JBrowse. You may not need to embed an >> iframe. Take a look at the noConflict method of jQuery: >> >> http://api.jquery.com/jQuery.noConflict/ >> >> This allowed us to use jQuery and JBrowse. >> >> -Andrew >> >> On Thu, Jul 1, 2010 at 4:04 AM, Philippe Bardou >> <phi...@to... >> <mailto:phi...@to...>> wrote: >> >> Hi, >> >> Due to jquery in our website I'm trying to embed JBrowse in an >> iframe. >> It works fine with google-chrome but nothing happens, nothing >> appears with IE8 and Firefox3.6.6. >> Do you have any idea ? >> >> Thanks a lot for your help >> >> Philippe >> >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first <http://sprint.com/first> -- >> http://p.sf.net/sfu/sprint-com-first >> _______________________________________________ >> Gmod-ajax mailing list >> Gmo...@li... >> <mailto:Gmo...@li...> >> https://lists.sourceforge.net/lists/listinfo/gmod-ajax >> > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > > > _______________________________________________ > Gmod-ajax mailing list > Gmo...@li... > https://lists.sourceforge.net/lists/listinfo/gmod-ajax > |