显示了跟随工具提示的链接,但并没有把我带到那里


link to follow on tooltip is shown but doesn't bring me there

使用底部的代码,a href部分确实显示了鼠标所在的相关链接,但是当我单击它时,它只是重定向到…/index.php#.

我需要一些编码帮助-所以它重定向我到实际的url -这是在var totalService3 = data.getValue(e。行,4);如我所说,它显示在工具提示div中

的问候彼得。

google.visualization.events.addListener(tree, 'onmouseover', function (e) {
    var provider = data.getValue(e.row, 0);
    var totalService = data.getValue(e.row, 2);
    var totalService2 = data.getValue(e.row, 3);
    var totalService3 = data.getValue(e.row, 4);
    // populate the tooltip with data
    $('#tooltipTopLine').html(provider);
    $('#tooltipMiddleLine').html(totalService);
    $('#tooltipBottomLine').html(totalService2);
    $('#tooltipHyperlink').html(totalService3);
    // show the tooltip
    $('#tooltip').show();
});

google.setOnLoadCallback(drawVisualization);
// make the tooltip div follow the mouse
$(function () {
    $('#visualization').mousemove(function (e) {
        $('#tooltip').css({
            left: e.pageX,
            top: e.pageY - 40
        });
    });
});
}

<div id="container" style="width:400px; height: 1200px;padding-top: 20px;">
    <div id="visualization" style="width: 400px; height: 400px;"></div>
    <div id="tooltip" style="padding-bottom:10px;"> <span id="tooltipTopLine"></span>
        <br />Price 1 <span id="tooltipMiddleLine"></span>
        <br />Price 2 <span id="tooltipBottomLine"></span>
        <br /><a href="#" id="tooltipHyperlink">Link</a>
    </div>

未测试:

google.visualization.events.addListener(tree, 'onmouseover', function (e) {
    // your code
    $('#tooltip a').attr('href', totalService3);
    // show the tooltip
    $('#tooltip').show();
});

google.visualization.events.addListener(tree, 'onmouseover', function (e) {
    //your code
    $('#tooltipHyperlink').attr('href', totalService3);
    // show the tooltip
    $('#tooltip').show();
});