云图 jQCloud

var data = [
		['北京', 8, 111],
		['台湾', 1, 111]
];

var string_ = "";

function SplitKeyWord() {
    for (var i = 0; i < data.length; i++) {
        var string_f = data[i][0];
        var string_n = data[i][1];
        string_ += "{text: '" + string_f + "', weight: '" + string_n + "',html: {'class': 'span_list',onmouseover:'on_mouseover(this,event)',onmouseout:'on_mouseout()',onclick:'ClickGJC(this)'}},";
    }
}
function on_mouseover(e, ev) {
    var txt = $(e).html();
    ev = ev || event;

    ey = ev.clientY + 320;
    //alert(ey);
    $.each(data, function (i, item) {
        if (txt == item[0]) {
            var html = item[0] + "<br />点击数<br />" + item[1] + "<br />" + item[1];
            $("#my_favorite_latin_words").after("<div class='append_div' style='display:none;left:" + ev.clientX + "px; top:" + ey + "px; '>" + html + "</div>");
            return;
        }

    });
}
function ShowKeyWords() {
    data = keywordsdata;
    SplitKeyWord();
    var string_list = string_;
    var word_list = eval("[" + string_list + "]");
    $("#my_favorite_latin_words").jQCloud(word_list);
}


function on_mouseout() {
    $(".append_div").remove();
}

 jqcloud-1.0.4.js

<div id="my_favorite_latin_words" style="width: 330px; margin: 0px auto; height: 330px;"></div>

  

 $.ajax({
            type: 'POST',
            url: "/Home/SearchYuntu",
            data: {
                //tempdata: $(".list_sea").text()
            },
            success: function (data) {
                var jsonData = JSON.parse(data)
                if (jsonData != null) {
                    if (jsonData.length > 0) {
                        for (var i = 0; i < jsonData.length; i++) {
                            keywordsdata.push(new Array(jsonData[i].ID, jsonData[i].UsingCount, jsonData[i].DisplayIndex));
                        }
                    }
                }
                ShowKeyWords();

            }
        });

 

转载于:https://www.cnblogs.com/caolingyi/p/8548449.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值