0
在这里,我有这样的代码:更改内容动态
$(function() {
$(document).tooltip({
items: ".draggable ui-draggable ui-resizable",
track: true,
content: function(){
var time = $(this).width();
if(time<0) {
time = 0;
}
var seconds = time%60;
var minutes = (time-seconds)/60;
var output;
if(minutes >= 10) {
output = ""+minutes;
} else {
output = "0"+minutes;
}
output += ":";
if(seconds >= 10) {
output += seconds;
} else {
output += "0"+seconds;
}
return output;
}
});
});
.draggable
类也可拖动和可调整大小的,我需要显示在提示动态变化的内容(时间HH /分钟)
如何我可以动态更改工具提示中的内容?
演示:http://jsbin.com/erofot/119
为什么提示内容不会动态改变,当我调整DIV?
感谢,我会尝试,然后标记你的答案 –
somwhere是错误.resizable({ 调整大小:函数(事件,UI){ 变量$此= $(event.currentTarget); $ this.tooltip( 'option','content',updateTooltipContent); } –
检查出我添加的小提琴,它显示代码的功能 – drizzie