FixSidebar introduction and correction log, fixsidebar correction log

Source: Internet
Author: User

FixSidebar introduction and correction log, fixsidebar correction log

FixSidebar is a self-written small component with fixed sidebar. It is mainly used to keep the sidebar Displayed For A Long Time of the main content, depending on jQuery.

Github addressHttps://github.com/iRuxu/iRuxu.ui/tree/master/fixSidebar

Example addressHttp://www.jx3pve.com/macro

The reason for the entire writing is that the Yuan Ren wants to write a course in MOOC, but the function is refined.

Usage

fixSidebar(selector,top,bottom,triggerScroll)

For example

fixSidebar('sidebar',30,80,100)

Parameter description

SelectorIt is a selector and will be passed into jQuery. If not, exit the function. Therefore, if you are lazy, load it directly in the global JS file.

TopIt is the passed-in distance from the top position. This is used if the fixed panel navigation or user bar exists, if the value is not passed, it is 0.

BottomIt is the input base-to-base position. This value should be set if you have global bottom navigation, etc, the margin can be slightly larger than the bottom column height. If the value is not set, the margin is 0.

TriggerScrollIt was added at v0.3. At that time, because the page in your private project had a header banner, you can set the value when triggering the fix if necessary, for example, this page is triggered after 250.

Built-in Automatic determination of the actual horizontal coordinates of the default page. When the length of the sidebar is smaller than the page length, the position is calculated based on the top by default. when the length of the sidebar is greater than the page length, the position is still calculated at the bottom.

In the recent application of the copy column, due to the existence of the magic lamp rolling, I found that a rolling exception occurred. For a long time, I found it was caused by the BFC management of the magic lamp overflow, the final solution is to set overflow: hidden for the input selector, which must manage itself. This item is automatically added to the function in v0.4, and no additional css settings are required.

 

Okay. At last, if you have better suggestions, you can give me feedback ~

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.