From 23f62ca0c74ff4d9629bd4effa9754c2e7f7f2cc Mon Sep 17 00:00:00 2001 From: vsync Date: Mon, 2 Jul 2018 22:01:41 +0300 Subject: [PATCH] -fixed demo page slowness on Chrome --- fakescroll.css | 2 ++ fakescroll.js | 2 ++ index.html | 4 +++- package.json | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/fakescroll.css b/fakescroll.css index 9950d12..50c96ed 100644 --- a/fakescroll.css +++ b/fakescroll.css @@ -1,3 +1,5 @@ +.fakeScroll__scope{ overflow:visible !important; } + .fakeScroll__wrap{ overflow : hidden; height : 100%; diff --git a/fakescroll.js b/fakescroll.js index e1da296..9777889 100644 --- a/fakescroll.js +++ b/fakescroll.js @@ -51,6 +51,8 @@ DOM.track = DOM.scrollWrap.nextElementSibling; DOM.bar = DOM.track.firstElementChild; + DOM.scope.classList.add("fakeScroll__scope"); + return DOM; }, diff --git a/index.html b/index.html index 838cb90..e3194c3 100644 --- a/index.html +++ b/index.html @@ -24,9 +24,11 @@ background-image: -moz-radial-gradient( top, circle cover, #3c3b52 0%, #252233 100%); background-image: -o-radial-gradient( top, circle cover, #3c3b52 0%, #252233 100%); background-image: radial-gradient( top, circle cover, #3c3b52 0%, #252233 100%); + background: #252233; } - .foo{ position:absolute; top:0; right:0; bottom:0; left:0; margin:auto; min-height:70%; height:1px; width:500px; } + .foo{ position:absolute; top:0; right:0; bottom:0; left:0; margin:auto; min-height:70%; height:1px; width:500px; overflow:auto; background:white; } + .foo.fakeScroll__scope{ background:none; } .foo .fakeScroll__content{ padding-top:1em; padding-bottom:1em; } .foo .fakeScroll__wrap{ background:#FFF; border-radius:4px; -moz-box-sizing:border-box; box-sizing:border-box; } diff --git a/package.json b/package.json index 71bfd75..cf5af24 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@yaireo/fakescroll", - "version": "2.0.0", + "version": "2.0.1", "homepage": "https://github.com/yairEO/fakescroll", "description": "Very lightweight & robust custom-looking HTML scrollbar script.", "_npmUser": {