English 中文(简体)
jjQuery 和时间采集器一起直播
原标题:jQuery live with time picker

要显示 .timePickr ,我需要做 双盘悬浮 并在我看到 .timePiker 框之前将鼠标移动到另一个地方, 当我使用 live 事件时 。

我怎样才能靠一个盘旋来撑过去?

$(".timePickr").live( hover , function() {
    $(function(){
        $(".timePickr").timepickr();
    });
});
最佳回答

问题在于您在“ 时间采集器” 输入后添加时间采集器。 “ 时间采集器” 已经启动 。 时间采集器要等到下次您盘旋时才会显示 。

有两个选项。 要么您再次触发悬浮事件 :

$(function() {
  $(".timePickr").live( hover , function() {
    $(this).timepickr();
    $(this).hover();
  });
});

一个更好的选项是移动代码,在文档加载函数中或每当您动态地引入新元素时应用时间采集器。

$(function() {
  $(".timePickr").timepickr();
});

//Somewhere else
$.get("someurl", null, function(data) {
  $("#some-div").html(data);
  $(".timePickr").timepickr();
});
问题回答

尝试此代码 :

$(function() {
   $(".timePickr").timePickr(); // set all timePicker on document load

   $(".timePickr").live( hover , function() {
       $(this).trigger( click );
   }); 
});




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签