lucaong / jQCloud

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

Fixed design breakage when generating multiple word clouds per page #2

Closed seanahrens closed 13 years ago

seanahrens commented 13 years ago

Luca, I modified the source to set ids dynamically off of the containing element's id string, so that there aren't namespace conflicts when multiple word clouds are created on a single page.

Instead of each word id being "word_" + index, now each word id is defined as + "word" + index.

This should mean that an arbitrary number of word clouds on a single page are possible without design issues.

Hope you accept :)

lucaong commented 13 years ago

thank you seanahrens! Well done! :)

seanahrens commented 13 years ago

Luca, I just realized that we should also change css styling to use .wordcloud (a class) instead of an #wordcloud (an id), because now the id should be a unique identifier given that you can now have multiple wordclouds per page.

ergo, the syntax should look like this (using parens cuz I can't figure out how to get brackets displayed):

#cloud 1
(div id="my_blog_posts" class="wordcloud" width... height...)(/div)

#cloud 2
(div id="my_interests" class="wordcloud" width... height...)(/div)

I'll make the above changes to the plugin (and readme) if you'll accept them when I push! Interested?

lucaong commented 13 years ago

Sean, I was thinking exactly the same. Applying style to a class makes much more sense. I'll absolutely accept a push that includes that change. Thanks again for your contribution! If you end up using jQCloud for something cool you may want to let me know, so I can link it in an "example" section and hopefully advertise your work a bit.