Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/244.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/76.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 函数this.text=text;到html_Php_Jquery - Fatal编程技术网

Php 函数this.text=text;到html

Php 函数this.text=text;到html,php,jquery,Php,Jquery,我有一些日历中tootlip的代码。我希望能够在工具提示中显示html,这可能吗?每次我尝试更改它以接受html时,它就会崩溃,现在只允许文本,我不知道如何更改它以允许html <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8">

我有一些日历中tootlip的代码。我希望能够在工具提示中显示html,这可能吗?每次我尝试更改它以接受html时,它就会崩溃,现在只允许文本,我不知道如何更改它以允许html

        <!DOCTYPE html>
        <html>
        <head>
          <meta http-equiv="content-type" content="text/html; charset=UTF-8">
          <title></title>

          <script type='text/javascript' src='http://code.jquery.com/jquery-1.8.2.js'></script>

          <link rel="stylesheet" type="text/css" href="/css/normalize.css">
          <link rel="stylesheet" type="text/css" href="/css/result-light.css">


              <link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css">
              <script type='text/javascript' src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>


          <style type='text/css'>
            .pink > a {
            background-color: pink !important;
            background-image:none !important;
        }

        .green > a {
            background-color: green !important;
            background-image: none !important;
        }

          </style>



        <script type='text/javascript'>//<![CDATA[
        $(window).load(function(){
        var Event = function(text, className) {
            // would like to convert this to allow for html
            this.text = text;
            // this.html = text; // does not work
            this.className = className;
        };

        var events = {};
        events[new Date("01/01/2013")] = new Event("New Years Day", "pink");
        events[new Date("12/25/2012")] = new Event("<B>Merry</b> Christmas", "green");

        console.dir(events);

        $("#dates").datepicker({
            beforeShowDay: function(date) {
                var event = events[date];
                if (event) {
                    return [true, event.className, event.text];
                }
                else {
                    return [true, '', ''];
                }
            }
        });
        });//]]>

        </script>


        </head>
        <body>
          <div id="dates"></div>


        </body>


        </html>

.pink>a{
背景色:粉红色!重要;
背景图像:无!重要;
}
.green>a{
背景色:绿色!重要;
背景图像:无!重要;
}
//
提前感谢您提供的任何代码或帮助


Johnny

title属性不允许使用html代码

但是有几个框架允许您修改悬停

我曾经


$('*')。工具提示();
在这里,您将看到它们的工具提示已被修改,粗体已就位


你到底在问什么?如何更改工具提示以显示html,从而使“圣诞快乐”字符串中的“圣诞快乐”变为粗体。Darn不允许我将代码粘贴到注释中,或者至少我不知道如何粘贴。我第一次使用stackoverflow.com时,您不应该使用事件作为变量名。这在Javascript中是一个保留字。@Johnny you在技术上是正确的-他们现在使用的是FandHydropdown.js而不是qtip-但这绝对不是对试图通过解释事情如何运作来帮助你的人的蔑视,特别是当他之前的观点是正确的(当时你对此不屑一顾)时。我想你不是以英语为母语的人。你应该知道,以“对不起,你错了”为形式的陈述是不屑一顾的,有些粗鲁——特别是当你不知道自己在说什么的时候。这就是我想要的,这个例子很完美,我很感激其他人指出它需要一个插件谢谢你,我选择这个解决方案,因为它有一个如何再次完成修复问题的示例。谢谢大家的输入和评论
<script src="http://jquery.bassistance.de/tooltip/jquery.tooltip.js"></script>
$('*').tooltip();