Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/239.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 有没有办法为yii中的CTAB视图选项卡添加工具提示?_Php_Yii_Tabs_Tooltip - Fatal编程技术网

Php 有没有办法为yii中的CTAB视图选项卡添加工具提示?

Php 有没有办法为yii中的CTAB视图选项卡添加工具提示?,php,yii,tabs,tooltip,Php,Yii,Tabs,Tooltip,我需要为选项卡添加工具提示。有没有办法在yii中为CTabView选项卡添加工具提示?我已经通过fn属性扩展了jQuery对象的功能 在视图文件中: 工作。唯一一件事:我在代码中做了更改,将“mouseover”替换为“mouseenter”事件。我认为CTabView小部件不包含此类功能。还有其他选择。您可以使用jquery。您可以为此创建Css mousehover类。 <?php Yii::app()->clientScript->registerScript('jq

我需要为选项卡添加工具提示。有没有办法在yii中为CTabView选项卡添加工具提示?

我已经通过fn属性扩展了jQuery对象的功能

在视图文件中:
工作。唯一一件事:我在代码中做了更改,将“mouseover”替换为“mouseenter”事件。

我认为CTabView小部件不包含此类功能。还有其他选择。您可以使用jquery。您可以为此创建Css mousehover类。
<?php 

Yii::app()->clientScript->registerScript('jquery-tooltip', '
$.fn.tooltip = function(tooltip_text)
{

// Mouse enters the target element
     $(this).on("mouseenter", function()
     {
        // Make the tooltip visible
        $("#tooltip").css("display", "inline");

        // Set custom text
        $("#tooltip").text(tooltip_text);

        // Start listening to the mousemove event, memory is allocated for it
        $(this).on("mousemove", function(event) {
            var x = event.pageX; // get mouse X position relative to the page (screen)
            var y = event.pageY; // get mouse Y position
            x = x + 32;  // move it to the right from the cursor
            y = y - 16;   // move it up
            $("#tooltip").css( {left: x, top: y} );
    });
});

// Mouse leaves the target element
$(this).off("mouseout", function()
{
    // Stop listening to the mousemove event, memory is released
    $(this).off("mousemove");
});

$(this).on("mouseout", function()
{
    // Hide the tooltip
    $("#tooltip").css("display", "none");
});
}
$(document).ready(function()
{
 $("a[href=\'#tab1\']").tooltip("tooltip text1");
 $("a[href=\'#tab2\']").tooltip("tooltip text2");
});
' , CClientScript::POS_END ); 
?>
<div id = "tooltip" '></div> 
#tooltip {
position: absolute;
width: auto;
display: inline;
padding: 8px;
font-family: Arial;
font-size: 14px;
color: #777777;
font-weight: bold;
border: 1px solid silver;
background: #FFFFEE;        /* Slightly yellow background */
border-radius: 5px;               /* Rounded corners */
box-shadow: 5px 5px 10px #DDD;  /* Tooltip shadow */
z-index: 30000;         /* A very large z-index ensures
                                   it's "always on top" */
}