📜 ⬆️ ⬇️

Javascripte rotating tag cloud

Recently on Habré there was a topic, in which it was told about a cloud on a flash . I looked, I liked it, I decided to repeat it on javascript-e. Here's what happened: demo mirror archive .
Creating a cloud happens like this:
var cloud = new Cloud(
{
radius:200,
parent: document .body
});
cloud.addTag([

{href: "#" ,w: "2" ,text: "" },
{href: "#" ,w: "2" ,text: "" },
{href: "#" ,w: "1" ,text: "" },
{href: "#" ,w: "1" ,text: "" }
]
);
var cloud = new Cloud(
{
radius:200,
parent: document .body
});
cloud.addTag([

{href: "#" ,w: "2" ,text: "" },
{href: "#" ,w: "2" ,text: "" },
{href: "#" ,w: "1" ,text: "" },
{href: "#" ,w: "1" ,text: "" }
]
);



I do not know whether it is useful, with a large number of tags it terribly slows down.
Tested in Mozilla 3, IE7.

PS If you like it, you can still somehow improve it, but so far I don’t see any sense :)
')
Here Habra user Kron0S made a plugin for wordpress based on my script.

Judging by the comments, it slows down a lot, I didn’t do much optimization with tags in the amount of 100 pieces on my machine (ntel Core 2 Duo 2.3 with 2Gb Vista FF3) almost doesn’t slow down waiting for your comments. Can someone suggest some other way to optimize the code ( Frameworks do not offer only algorithms ).

Source: https://habr.com/ru/post/38264/


All Articles