Javascript 为什么qtip2工具提示中的onclick事件不起作用?
在下面给出的JSFIDLE链接中,有2个按钮,单击其中任何一个按钮都会显示工具提示。我希望工具提示中的按钮可以更改“删除”文本和“输入文本”(使文本字段可编辑)的显示和其他属性。问题是该值会更新,但文本仍不可编辑。请建议解决该问题的方法 HTML CSSJavascript 为什么qtip2工具提示中的onclick事件不起作用?,javascript,jquery,button,qtip2,Javascript,Jquery,Button,Qtip2,在下面给出的JSFIDLE链接中,有2个按钮,单击其中任何一个按钮都会显示工具提示。我希望工具提示中的按钮可以更改“删除”文本和“输入文本”(使文本字段可编辑)的显示和其他属性。问题是该值会更新,但文本仍不可编辑。请建议解决该问题的方法 HTML CSS 我建议您使用jquery选择器: $(".menuitem").click(function(){ $("#try").attr('readonly', false); $("#delete").hide(); aler
我建议您使用jquery选择器:
$(".menuitem").click(function(){
$("#try").attr('readonly', false);
$("#delete").hide();
alert($(this).text());
});
也许可以帮到你不,这不是我想要的..我使用html属性类和使用类访问元素解决了这个问题。。
$(function() {
$("#gear").button({
icons: {
primary: "ui-icon-gear",
secondary: "ui-icon-triangle-1-s"
},
text: false
}).qtip({
content: {
text: $('#menu')
},
show: {
event: 'click',
solo: true,
modal: true
},
style: {
classes: 'ui-tooltip-dark ui-tooltip-shadow'
},
position: {
my: 'top center',
at: 'bottom center',
}
});
$("#gear1").button({
icons: {
primary: "ui-icon-gear",
secondary: "ui-icon-triangle-1-s"
},
text: false
}).qtip({
content: {
text: $('#menu')
},
show: {
event: 'click',
solo: true,
modal: true
},
style: {
classes: 'ui-tooltip-dark ui-tooltip-shadow'
},
position: {
my: 'top center',
at: 'bottom center',
}
});
$(".menuitem").click(function(){
document.getElementbyId("try").readOnly = false;
document.getElementbyId("delete").style.display = none; alert($(this).text());
});
});
#gear {
margin:100px;
}
.menuitem {
padding-left: 10px;
padding-right: 10px;
font-size: 9px;
margin-bottom: 3px;
width: 75px;
}
$(".menuitem").click(function(){
$("#try").attr('readonly', false);
$("#delete").hide();
alert($(this).text());
});