vursen / floatsidebar.js Goto Github PK
View Code? Open in Web Editor NEWA lightweight (2kb gzipped), zero-dependency javascript library for making a sidebar float.
License: MIT License
A lightweight (2kb gzipped), zero-dependency javascript library for making a sidebar float.
License: MIT License
如果窗口不够宽,窗口底部会出现横向滚动条,此时将窗口底部的横向滚动条滑动到中间,然后上下滑动页面,右侧边栏会抖动。
If the window is not wide enough, a horizontal scroll bar will appear at the bottom of the window. At this time, slide the horizontal scroll bar at the bottom of the window to the middle, then slide the page up and down, and the right sidebar will shake.
Just to thank you for your wonderful script. It helped me a lot. I'm getting a Uncaught TypeError in dev console at line: 396 ( var $sideInner = options.sidebarInner || $sideOuter.firstElementChild;
)
When I hover over the error it says: Uncaught TypeError: Cannot read property 'firstElementChild' of null.
Although your script works as expected.
Any thoughts?
Thanks
Here is a sample: https://jsfiddle.net/71zwtoLu/
If you scroll downwards, almost at half of the page, you will see that the "TOP LINES" part of the sidebar will jump into view. It works fine with smaller items.
Is this a limitation, is there a workaround for this?
Thanks for the nice extension. Adding an offset option to start the scroll triggering from that offset position would be a great addition. Currently, it works with window
as the viewport; if we could add an offset to move down the scroll target position, it could be implemented easily with a fixed header.
Thanks
Hi,
first thanks for this great float sidebar plugin, its very easy to implement and works great.
But, I'm having a little trouble with
var sideOuterHeight = Math.max(dim$sideInner.height, pathHeight);
It sets height of my sidebar everytime I scroll and it gets bigger and bigger so I can't scroll to bottom of the page.
So I decided to use only dim$sideInner.height
and it works fine.
Am I doing something wrong or why should I want to use pathHeight?
Thanks :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.