lucaong / jQCloud

jQuery plugin for drawing neat word clouds that actually look like clouds
MIT License
646 stars 293 forks source link

jQcloud and jquery Mobile #11

Closed ekorn closed 13 years ago

ekorn commented 13 years ago

Hi Luca, I try to use jQcloud with jquery Mobile but it show some strange side effects. If the cloud is directly loaded everything is fine, but if use the virtual pages of jqm, on the second page the cloud is concentrated. I wanted to make you a jsfiddle but for some reason the css file was not applied, so I uploaded my test page here[1]. It would be great if the two pieces of software would work together.

Cheers Nico

[1] jhttp://www.phrasenkueche.de/jqcloud-jqm/examples

lucaong commented 13 years ago

Nico, it's probably because jQCloud needs to know each word's dimension to correctly place them. Now, if the container is not visible when jQCloud is called, every word has width and height equals to zero, so jQCloud mistakenly thinks they can all fit in a tiny space. You may try rendering the cloud only when you show the page in which it is displayed. E.g. in your example you could try something like:

$("a[href=#bar]").click(function() { $("#my_favorite_latin_wordsPage2").html(""); $("#my_favorite_latin_wordsPage2").jQCloud(word_list); });

What I'm doing there is just clearing the container and re-rendering the cloud when a link to the second page is clicked. I didn't have much time to try it out, but in the console it seems to work. Let me know how it works. Thanks for your interest in jQCloud!

Luca

On Thu, Jul 21, 2011 at 10:41 PM, ekorn reply@reply.github.com wrote:

Hi Luca, I try to use jQcloud with jquery Mobile but it show some strange side effects. If the cloud is directly loaded everything is fine, but if use the virtual pages of jqm, on the second page the cloud is concentrated. I wanted to  make you a jsfiddle but for some reason the css file was not applied, so I uploaded my test page here[1]. It would be great if the two pieces of software would work together.

Cheers Nico

[1]  jhttp://www.phrasenkueche.de/jqcloud-jqm/examples

Reply to this email directly or view it on GitHub: https://github.com/DukeLeNoir/jQCloud/issues/11

ekorn commented 13 years ago

Hi Luca, thanks it worked fine this way, if want to my project it's here : http://twapperlyzer.cs.upb.de/ It pretty alpha at the moment and only works in chrome :(