1

DIVにjQueryプラグインniceScrollを実装しています。niceScrollを使用しているタグに.load()関数を追加した場合を除いて、これは美しく機能します。スクロールは機能しません。しかし、niceScrollを削除すると、ネイティブスクローラーは正常に機能します...?

これはwebKitブラウザを対象としています。何かアイデアがありますか、それとも私は自分のコードで間抜けになっていますか?

$(document).ready(
            function(e) {

                $("#west").load('http://mySite.comregulatory_list.php', '', function(response, status, xhr) {
                    if (status == 'error') {
                        var msg = "Sorry but there was an error: ";
                        $(".content").html(msg + xhr.status + " " + xhr.statusText);
                    }

                });

                $("#west").niceScroll({
                    cursorcolor : "#6699FF",
                    cursorwidth : "2px",
                    grabcursorenabled : "false",
                    preservenativescrolling : "false",
                    cursorborder : "0px",
                    scrollspeed : "20",
                });
            })
4

1 に答える 1

1

niceScrollプラグインはほぼ確実に要素のHTML構造を更新しているため、要素#west内の特定のコンテンツコンテナをターゲットにするか、新しいコンテンツを読み込むときにプラグインを#west再初期化する必要があります。niceScroll

            $("#west").load('http://mySite.comregulatory_list.php', '', function(response, status, xhr) {
                if (status == 'error') {
                    var msg = "Sorry but there was an error: ";
                    $(".content").html(msg + xhr.status + " " + xhr.statusText);
                } else {
                    $(this).niceScroll({
                        cursorcolor : "#6699FF",
                        cursorwidth : "2px",
                        grabcursorenabled : "false",
                        preservenativescrolling : "false",
                        cursorborder : "0px",
                        scrollspeed : "20",
                    });
                }

            });
于 2012-03-15T21:00:22.530 に答える