0
マウスの高速移動(いつものようにIEのみ)では、両方のホバーハンドラーがトリガーされるため、何も表示されません。 hoverIntendを使用しようとしましたが、そのプラグインがe.pageX/Yで混乱しています これを修正する方法があれば、5時間後には成功しませんでした。マウスを動かすと、Jqueryのホバーが両方のハンドラーを起動します
yOffset = 10;
xOffset = 30;
$("img.hover-preview").hover(function(e){
//alert('hover');
this.t = this.title;
this.title = "";
var c = (this.t != "") ? "<br/>" + this.t : "";
preview_link = $('#' + this.id + '-url').attr('src'); //Get the src of the bigger preview image
zoom_link = $('#' + this.id + '-url-zoom').attr('src'); //Get the src of the ZOOM image
//Output of the preview element
$("body").append("<div id='hover-preview-active'><img src='"+ preview_link +"' alt='Loading Image Preview' /><span>"
+ Drupal.t("Press and hold Z key to zoom") + "</span></div>");
$("#hover-preview-active")
.css("top", (e.pageY - yOffset) + "px")
.css("left",(e.pageX + xOffset) + "px")
.fadeIn("fast");
},
function(){
this.title = this.t;
$("#hover-preview-active").remove();
});
どのように機能しますか? –
それはadityaからの解決策と一緒に働いています –