如何确保按钮的工具提示仅在禁用按钮时可见?
我可以将工具提示的可见性绑定到什么?
我正在创建一个ExtJS组件,我希望它使用QuickTips工具提示.如果我使用DomHelper创建一个元素,我可以设置一个工具提示,没有汗水.但是,如果我制作一个组件,就像
new BoxComponent({
qtip: "This is a tip"
});
Run Code Online (Sandbox Code Playgroud)
什么都没发生.我也试过命名属性"tooltip",但没有运气.有没有正确的方法来做到这一点?我现在的黑客行为是有效的
new BoxComponent({
qtip: "This is a tip",
listeners: {
rendered: function(c){
Ext.QuickTips.register({
target: c.getEl(),
text: c.qtip
}
}
});
Run Code Online (Sandbox Code Playgroud)
我觉得这样不可能.我想我可以只扩展Component来自动完成,但这似乎是一个很常见的情况,我应该能够做到这一点,而不是像这样在引擎盖下戳.
我正在使用表单基本验证来检查电子邮件格式是否正确,然后数据由Ajax发送,它检查电子邮件地址是否已被使用并且用户选择国家/州或在选择框中保留默认值.
但是对于要完成的HTML5表单验证,需要提交事件,如果它通过了基本表单验证,则会执行Ajax操作,但是当结果出现时,我想使用相同的浏览器工具提示来实现界面一致性(我很好)喜欢他们的样子).
那么有没有办法让它们出现,我无法找到它们是否有某些特殊事件或者类似于触发提交事件但是立即停止它.此时,该字段仅获得红色边缘,并且鼠标悬停在其上时会显示错误消息,而工具提示再次显示单击"提交"按钮.
对于没有本机工具提示的浏览器(在我的情况下是Safari),我使用的是Webshims Lib,它的行为与Chrome和Firefox完全相同.
我正在尝试设置工具提示JEditorPane.我用来确定要显示哪些工具提示文本的方法是相当CPU密集型的 - 所以我想只在鼠标停止很短的时间后显示它 - 比如1秒.
我知道我可以使用ToolTipManager.sharedInstance().setInitialDelay(),但这会立即设置所有摆动组件上工具提示的延迟时间,我不希望这样.
当鼠标悬停在禁用的控件上时,我正在尝试显示工具提示.由于禁用的控件不处理任何事件,我必须在父表单中执行此操作.我选择通过处理MouseMove父表单中的事件来完成此操作.这是完成工作的代码:
void Form1_MouseMove(object sender, MouseEventArgs e)
{
m_toolTips.SetToolTip(this, "testing tooltip on " + DateTime.Now.ToString());
string tipText = this.m_toolTips.GetToolTip(this);
if ((tipText != null) && (tipText.Length > 0))
{
Point clientLoc = this.PointToClient(Cursor.Position);
Control child = this.GetChildAtPoint(clientLoc);
if (child != null && child.Enabled == false)
{
m_toolTips.ToolTipTitle = "MouseHover On Disabled Control";
m_toolTips.Show(tipText, this, 10000);
}
else
{
m_toolTips.ToolTipTitle = "MouseHover Triggerd";
m_toolTips.Show(tipText, this, 3000);
}
}
}
Run Code Online (Sandbox Code Playgroud)
代码确实处理禁用控件的工具提示显示.问题是当鼠标悬停在禁用的控件上时,工具提示会一直关闭并重新显示.从我在工具提示中添加的显示时间开始,当鼠标位于父窗体上方时,MouseMove事件大约每3秒调用一次,因此工具提示每3秒更新一次.但是当鼠标在禁用的控件上时,工具提示每1秒刷新一次.此外,当工具提示在表单上方刷新时,只有文本会通过简短的闪存进行更新.但是当工具提示在禁用的控件上方刷新时,工具提示窗口会关闭,就像鼠标移动到启用的控件中一样,工具提示应该关闭.但随后工具提示立即重新出现.
有人能告诉我为什么会这样吗?谢谢.
我正在做一些教学练习,用XSLT,Javascript和Raphael将XML转换为SVG.我确信这是艰难的方式......但它具有教育意义.
我遇到的问题是创建工具提示.到目前为止,我已经找到了三种方法:
.attr({title: "blah"{)在对象上使用.这是有效的,但拉斐尔并没有正式支持它,我想在工具提示中加入的内容可能有点长,这是人们操作系统在人们读完之前超出工具提示的问题.所以,我想知道的是,向Raphael对象添加工具提示是一种简单可靠的方法,以便当人们鼠标悬停在对象上时弹出工具提示,并在鼠标输出时(但不是之前)消失?
http://code.google.com/apis/chart/
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
// Load the Visualization API and the piechart package.
google.load('visualization', '1', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {
// Create our data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'date');
data.addColumn('number', 'Views');
data.addColumn('number', 'People');
data.addRows([
<?php echo $analytics; ?>
]);
// …Run Code Online (Sandbox Code Playgroud) 我正在开发一个项目,预计会显示这个图:http://jsfiddle.net/Kc23N/
当我点击一个点(工具提示)时,我想显示一个可以理解的日期,而不是以毫秒为单位的值.
我认为需要改变这段代码:
tooltip: {
headerFormat: '<b>{series.name}</b><br>',
pointFormat: '{point.x} date, {point.y} Kg',
}
Run Code Online (Sandbox Code Playgroud)
我该怎么办?任何善意的帮助表示赞赏.
谢谢
Apparently after the last Chrome update(ver 78.0.39) there is a new feature(tab tooltip, it's quite distracting):
How can I disable this?
我正在使用jQuery UI Tooltip小部件
<li>
<div class="i1">
<a href="#inf-1"title="??????????">
<span class="ui-icon ui-icon-search"></span>
</a>
</div>
</li>
<li><a href="#inf-2"title="???????????"><span class="ui-icon ui-icon-info"></span></a></li>
<li><a href="#inf-3"title="???????"><span class="ui-icon ui-icon-copy"></span></a></li>
Run Code Online (Sandbox Code Playgroud)
我根据他们的例子编写了以下CSS,它就像一个魅力:
.tooltip {
display:none;
background: black;
font-size:12px;
height:10px;
width:80px;
padding:10px;
color:#fff;
z-index: 99;
bottom: 10px;
border: 2px solid white;
/* for IE */
filter:alpha(opacity=80);
/* CSS3 standard */
opacity:0.8;
}
Run Code Online (Sandbox Code Playgroud)
但我有3-4个工具提示,我想看起来不同(如上面的示例html)所以我将它们包装在一个类中并执行此操作:
.i1 .tooltip {
display:none;
background: red;
font-size:12px;
height:40px;
width:80px;
padding:20px;
color:#fff;
z-index: 99;
bottom: 10px;
left: 50px important!;
border: 2px solid white;
/* for IE */
filter:alpha(opacity=80); …Run Code Online (Sandbox Code Playgroud) tooltip ×10
javascript ×3
jquery ×3
css ×2
api ×1
binding ×1
c# ×1
charts ×1
extjs ×1
forms ×1
highcharts ×1
html5 ×1
java ×1
performance ×1
popup ×1
raphael ×1
svg ×1
swing ×1
tabs ×1
updates ×1
validation ×1
visibility ×1
winforms ×1
wpf ×1