jcarousel 不会在图像上触发事件
单击下一步按钮后,jcarousel 不会在图像上触发事件。 事件被绑定用于图像的初始加载。
我添加了用于在轮播中显示图像预览的代码。
任何人都可以帮忙解决这个问题吗,
谢谢
function imagePreview() {
xOffset = 50;
yOffset = 60;
$("img.preview").hover(function (e) {
this.t = this.title;
this.title = "";
var c = (this.t != "") ? "<br/>" + this.t : "";
PageMethods.GetItemLargeImage(this.id, largeImageSucceed, largeimageFail);
$("img.preview").mouseout(function () {
document.getElementById("displayPreviewImage").src = "";
})
},
function () {
this.title = this.t;
$("#preview").remove();
});
$("img.preview").mousemove(function (e) {
$("#preview")
.css("top", 100 + "px")
.css("left", 400 + "px");
});
function largeImageSucceed(result) {
document.getElementById("displayPreviewImage").src = result;
}
function largeimageFail() {
//alert('hi');
}
}
jcarousel is not firing event on images after clicking on next button.
Event is binded for initial load of images.
i have added the code which i'm using to show preview of the image in carousel.
can any one please help on this,
Thanks
function imagePreview() {
xOffset = 50;
yOffset = 60;
$("img.preview").hover(function (e) {
this.t = this.title;
this.title = "";
var c = (this.t != "") ? "<br/>" + this.t : "";
PageMethods.GetItemLargeImage(this.id, largeImageSucceed, largeimageFail);
$("img.preview").mouseout(function () {
document.getElementById("displayPreviewImage").src = "";
})
},
function () {
this.title = this.t;
$("#preview").remove();
});
$("img.preview").mousemove(function (e) {
$("#preview")
.css("top", 100 + "px")
.css("left", 400 + "px");
});
function largeImageSucceed(result) {
document.getElementById("displayPreviewImage").src = result;
}
function largeimageFail() {
//alert('hi');
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我对此有解决方案。以前我通过创建 PageRequestManager 实例并在页面结束请求后触发它来调用。它以这种方式工作,但问题是事件并未绑定到所有 UL 元素。
现在我在图像的 onmouseover 事件上调用此方法。
所以现在工作正常。
I got solution for this. previously i was calling by creating PageRequestManager instance and and firing it after page end request. It was working in this way but the issue was event was not binding to all the UL elements.
Now i'm calling this method on onmouseover event of an image.
so its working fine now.