简体   繁体   English

jcarousel没有触发图像上的事件

[英]jcarousel is not firing event on images

jcarousel is not firing event on images after clicking on next button. 单击下一步按钮后,jcarousel不会在图像上触发事件。 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');
        }


    }

I got solution for this. 我对此有解决方案。 previously i was calling by creating PageRequestManager instance and and firing it after page end request. 以前,我是通过创建PageRequestManager实例并在页面结束请求后触发它来调用的。 It was working in this way but the issue was event was not binding to all the UL elements. 它以这种方式工作,但问题是事件未绑定到所有UL元素。

Now i'm calling this method on onmouseover event of an image. 现在,我在图像的onmouseover事件上调用此方法。 so its working fine now. 所以现在工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM