JS-Cumulus v0.2
WP-Cumulus in JavaScript made by jerone.
The latest version of this script can be found on GitHub.
Intro
I always loved the widely used WP-Cumulus made by Roy Tanc. This is a widget original made for Wordpress that shows all blog tags or categories. The tags rotate in a 3D circular way when you hover over the container and will slowdown when you hover over one to make it possible to click the tag.
The only downside this widget has, is that it’s made in Flash. I don’t hate flash, don’t get me wrong, but it has it flaws as people depend on a third party program, it isn’t very SEO compatible, is another language to learn and many more disadvantages. And I’ve always said; “What you can do in Flash, I can do in Javascript.”. And that’s the reason this project has started: JS-Cumulus.
So JS-Cumulus is a prove of concept. It has to prove that it can do the same thing as his older brother WP-Cumulus. I also wanted to not depend on Javascript libraries, so it could be added to any site.
And with this piece of code I can say for sure this has succeeded. It even adds more functionality then the original and is customizable with both Javascript and CSS. It doesn’t depend on libraries and when set up correctly it is even backwards compatible.
Some of the features are:
- Same features as WP-Cumulus.
- SEO compatible.
- No need for third-party addons.
- Javascript libraries independed.
- Doesn't uses a server.
- Text and images possible.
- Controls available.
- Cross browser. Tested working in all major browsers: Internet Explorer 6 - 8, Firefox 1 - 3.6, Opera 10, Chrome 1 - 5 and Safari 4. It should work with newer browsers and may work with older browsers, no promise until tested.
Options
Usage
HTML
Place the following code in the head of your page.
<!-- Mandatory JavaScript files -->
<script type="text/javascript" src="js-cumulus.min.js"></script>
<!-- JS-Cumulus definition -->
<script type="text/javascript">
(function() {
var tags1 = [
new Tag("JS-Cumulus", 100, "http://www.jeroenvanwarmerdam.nl"),
new Tag("Tag 1", 50),
new Tag("Tag 2"),
new Tag("<del>No flash</del>"),
new Tag("<img src='tagcloud.gif' alt='tagcloud' />")
];
new TagCloud(tags1, 400, 400).Distribute(document.getElementById("tagCloud1")).Animate();
})();
</script>
<!-- JS-Cumulus style -->
<style type="text/css">
.tagCloud {
background: transparent url("background.gif") 0 0 repeat;
}
.tagCloud ul, .tagCloud li {
list-style: none;
margin: 0;
padding: 0;
}
.tagCloud .tagClass img {
border: 0 none;
}
.tagCloud .tagClass a {
color: #fff;
font-family: Sans;
font-weight: normal;
padding: 3px;
text-align: center;
text-decoration: none;
vertical-align: middle;
}
.tagCloud .tagClass a:hover {
border: solid 1px #ffdb00;
color: #ffdb00;
text-decoration: none;
}
#jsCumulus1 { /* style for tag 1 */
color: #86C25E;
}
#jsCumulus2 { /* style for tag 2 */
color: #50B5D5;
}
</style>
JS-Cumulus must be called after the document is loaded. You can use an external Javascript library to do that for you or you can place above Javascript in the body after the place where you want the JS-Cumulus to be.
Download
A zip archive for this script is available here: js-cumulus-0.2.1.zip (size: 119kb).
The zip archive contains the following files:
- js-cumulus.js - actual script (size: 15kb).
- js-cumulus-min.js - minified script version (size: 7kb).
- js-cumulus.html - clean example page (size: 5kb).
Changelog
-
version 0.3 Development (soon...):
- ...
-
version 0.2.4 (12/18/0201):
- MOD: clean up;
- FIX: changed HoverStop to procents; 7870a73a3525fd24dcb918aa66dc9a89ced6747e
-
version 0.2.3 (12/18/0201):
- MOD: clean up;
- FIX: changed HoverStop to procents; 4739455b5b3c6d3a6c37506c2e3e68e849ad18ed
- FIX: documentation; 4739455b5b3c6d3a6c37506c2e3e68e849ad18ed
- ADD: style properties for tags 372f6d7e19dbb4eae39dfb1d9c27c59755dbf790
-
version 0.2.2 (12/18/0201):
- MOD: clean up;
-
version 0.2.1 (2/5/2010):
- FIX: fixed bug with manual Animate();
-
version 0.2 (2/5/2010):
- ADD: default element;
- ADD: running Distribute when element is known;
- ADD: option to override existing html in the given element;
- FIX: small bug in Update;
- FIX: detection of HTML Element;
- FIX: minor memory leaks;
- FIX: recalculated attractor position
- MOD: cleaned up code;
- MOD: reactivate second tagcloud;
- MOD: updated Distribute function;
- MOD: changed tag id declaration;
- MOD: updated documentation;
- MOD: updated example page;
- MOD: changed example to HTML5;
- MOD: improved tag widget example
-
version 0.1 (1/18/2010):
- Initial release;
FAQ
Which browsers is this plugin compatible with?
Tested working in Internet Explorer 6 - 8, Firefox 1 - 3.6, Opera 9 & 10, Chrome 1 - 5 and Safari 4.
It should work with newer browsers and can work with older browsers, no promise until tested.
Does the plugin work with any other plugins?
There's no build-in support for other plugins.
Is there a VSDoc file available for this plugin?
Yes, there's a VSDoc file available on the download page.
What is VSDoc?
VSDoc is documentation format for Visual Studio.
By using this file information is added to JavaScript Intellisense. This is only available in VS2008.
Related information
Known issues
- -
Todo
- IDEA: Mouse panning, zooming;
- ADD: Documentation;
- ADD: Z-sorting;
- ADD: Slow down more on tag mouse focus;
- ADD: Calculating the color instead using the Opacity property;
- ADD: Tags from xml;
Site Search