iT邦幫忙

0

JQuery/網頁Scrollbar樣式

想請問:

在網頁中加入了以下的scrollbar樣式
http://manos.malihu.gr/jquery-custom-content-scroller/

但一直無法成功,會變成下面頁面的狀況
*畫面scrollbar無法滾動
*原本圖樣可以跳lightbox的設定也失效
*左邊slide menu在加入scrollbar樣式後感覺動作也比較卡卡的,不像原本很順)
http://phoebe.byethost33.com/#

感謝~

網頁原檔案
https://dl.dropboxusercontent.com/u/61176848/demo.rar

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

6
fillano
iT邦超人 1 級 ‧ 2013-12-06 18:52:43
最佳解答

把:

<pre class="c" name="code">
$('html').mCustomScrollbar();

改成:

<pre class="c" name="code">
$(document).mCustomScrollbar();

就好了。

看更多先前的回應...收起先前的回應...
kusabi iT邦新手 5 級 ‧ 2013-12-06 23:07:33 檢舉

感謝回覆~
但改成document之後jquery的scrollbar樣式就完全沒有作用了
http://phoebe.byethost33.com/#

原本用html時,在其它頁面時可以正常顯示scrollbar樣式和滾動,但頁面中其它lightbox的jquery一樣會失效無作用:
https://dl.dropboxusercontent.com/u/61176848/artifact02.html

fillano iT邦超人 1 級 ‧ 2013-12-06 23:13:43 檢舉

我看錯了,應該是:

<pre class="c" name="code">
            $('#right').mCustomScrollbar();
fillano iT邦超人 1 級 ‧ 2013-12-06 23:16:03 檢舉

我猜你是要讓右邊這個div可以這樣scroll。

如果要讓整個網頁套用,那用:

<pre class="c" name="code">
            $('body').mCustomScrollbar();

body是可視元素的root了,他的offsetParent是null。

fillano iT邦超人 1 級 ‧ 2013-12-06 23:27:21 檢舉

嗯,看來還需要加上:

<pre class="c" name="code">
    $.get(_clickTab, function(data) {
        $("#right").html(data);	
        $('#right').mCustomScrollbar();
    });
fillano iT邦超人 1 級 ‧ 2013-12-06 23:51:24 檢舉

另外,透過$.get把頁面載入到某個div等,這些頁面最好調整一下,只留下body之內的元素就好(不含body)。有些lightbox透過這種方式載入時,如果有html、body等,會影響他判斷正確的寬、高。

我要發表回答

立即登入回答