javascript: fixed navigation scrolls too far and covers the top of the content

I have a fixed browser that I created in React, but when I click on a link, the window scrolls too much and the browser covers the top of the content. I have tried to dynamically calculate the height of the navigation and take this into account in the displacement, but it still goes to the wrong position.

import react from & # 39; react & # 39;
import {string} from & # 39; prop-types & # 39;

The FixedNav class extends React.Component {
constructor (accessories) {
super (accessories)

this.handleClick = this.handleClick.bind (this)
}

shouldComponentUpdate (nextProps) {
returns nextProps.navItems! == this.props.navItems
}

handleClick on (e) {
const nav = document.querySelector (& # 39; # fixedNav & # 39;)
we go to navHeight = nav.getBoundingClientRect (). height
leave itemLink = document.querySelector (e.target.parentElement.dataset.link)
leave scrollHeight = itemLink.offsetTop - navHeight
window.scroll (0, scrollHeight)
window.location.hash = e.target.parentElement.dataset.link
e.preventDefault ()
}

createNavItems () {
const {navItems} = this.props
returns navItems.map ((item, key) => {
const itemLink = items[1].link
he came back (
        
  • { articles[0] }

  • ) }) } render () { const navItems = this.createNavItems () he came back (
      {navItems}
    ) } } FixedNav.propTypes = { Nav Articles: string.isRequired } default export FixedNav

    Theory of complexity – Matrix that covers by squares.

    I wonder about the following decision problem:

    Instance: we consider a $ n times p $ matrix $ M $ of zeros and ones, and two integers. $ N $ Y $ k $.

    Question: Is it possible to cover all of the matrix with $ N $ side length squares $ k $?

    It is possible that the squares cover some of the zeros in the matrix and that they can overlap each other.

    I have the impression that it is $ textsf {NP} $-complete (it is clear $ textsf {NP} $), I find some similarities with the grid that covers rectangles, but I can not find a good reduction.

    Can I get any idea about the problem?

    Thank you.

    JoyFreak now supports covers for profiles and threads | Promotion Forum

    Manufacturer of outdoor covers – Advertising, Offers

    Many of us find that our outer covering is becoming a gray area behind our house, which has many uses (like storage and a place to hang the washing) but has no real purpose. If this is the case, or you simply feel that you are not making the best of your platform, it is time for a summer review. Instead of starting with house and garden type magazines to get ideas, which are generally too ambitious for the average homeowner, instead of seeking inspiration from friends and even neighbors. If you've admired other people's exterior covers for their functionality and elegant designs, it's time for your platform to look so good. Zhejiang Meidian New Material Co., Ltd is a leading manufacturer of plastic wood composites in Zhejiang province in China. We focus on the production and sale of wood plastic composites. We use recycled wood fiber and plastic (HDPE) to compose the cover material for outdoor construction, 100% environmentally friendly with FSC, CE and ASTM D certification. Visit here https: //www.zjmeidian. com

    Swimmingpoolwpcdecking_1_151552461799 (1) .jpg

    Designer of e-book covers

    I have three covers of electronic books that I need to be designed. Please send me a PM for your cost for coverage and samples of your work.

    Geometría de ag.algebraic – Finite covers etale of products of curves

    Probably this question can be formulated in a much greater generality, but I will simply expose it in the generality that I require. I work more $ mathbb {C} $.

    Leave $ C_1, C_2 subset mathbb {P} ^ 1 $ be open subsets not empty and $ f: X to C_1 times C_2 $ A non-trivial finite etale cover. There exists $ i en {1,2 } $ such that the composition $ X to C_1 times C_2 to C_i $ Do you have unconnected fibers?

    reference request – Finite covers of Boolean algebras for their subalgebras

    It is a student exercise that no group can be represented as a union of the set theory of its two appropriate subgroups. The same can be shown for Boolean algebras. On the other hand, it is not difficult to prove that any infinite Boolean algebra $ mathcal {A} $ can be covered by your $ k $ appropriate subalgebras $ mathcal {A} _0, ldots, mathcal {A} _ {k-1} $, where $ k in mathbb {N} setminus {0,1,2,4 } $, such that $ mathcal {A} _i not subseteq bigcup_ {j neq i} mathcal {A} _j $ for each $ i <k $. However, I'm not sure if $ k = 4 $ I really should be excluded here. So, my question is this:

    Q: Leave $ mathcal {A} $ Be an infinite Boolean algebra. Do your own subalgebras always exist? $ mathcal {A} _0, mathcal {A} _1, mathcal {A} _2, mathcal {A} _3 $ such that $ mathcal {A} = bigcup_ {i <4} mathcal {A} _i $ Y $ mathcal {A} _i not subseteq bigcup_ {j neq i} mathcal {A} _j $ for each $ i <4 $?

    I suspect that a careful (and tedious) analysis of the cases could show that the answer is negative (equally for $ k = 2 $), but perhaps there is some intelligent proof (or refutation) of it. I am also asking you about possible references to documents or books in which such problems are studied.

    (I asked the same question in the Math Stack Exchange, but the interest was literally zero).

    Optics: Can lens covers become too tight to become accidental openings?

    Vignetting is an opening effect, visible in the corners rather than in the center.

    Since the border edge of the lens cover is a few centimeters in front of the lens, its effect is not evenly distributed throughout the image area, but is more prominent at the corners.

    Then, before the hood has a real impact on the overall exposure, you will clearly see a vignetting.

    A few years ago, when I was experimenting with several lenses and special hoods for my SLR camera, I built a card-box adapter that simulated my SLR camera body (correct focal length of the flange) with a cut-out that equals the film size of 24 by 36 mm. If looking from the "film layer" to the lens, could not see any part of the lens cover, vignetting could not be a problem.

    Convex geometry – Volume of covers of a polytope.

    Leave $ K $ be a politician in $ mathbb R ^ d $, exploit it by a factor $ lambda> 0 $. For a unitary vector. $ u in mathbb S ^ {d-1} $, $ lambda K $ has 2 support hyperplanes $ H_1 $ Y $ H_2 $ with its corresponding normal vectors towards the outside. $ u $ Y $ -u $. I only take into account $ u $It is such that $ H_1 $ Y $ H_2 $ they have a "good" position, which says they are not parallel to any face of $ K $, or equivalently, contain a single vertex of $ lambda K $.

    Consider another parallel hyperplane. $ H_t $ such that the distance between him and $ H_1 $ is $ t $ (Of course $ t $ is smaller than the width of $ lambda K $ in the direction $ u $). So $ H_1 $ Y $ H_t $ define a limit of $ lambda K $.

    My question is:
    Is there a possibility that we can estimate the volume of that limit, in terms of $ u, lambda $ Y $ t $?

    The easiest case is when $ t $ is smaller than the distance from the nearest vertex $ lambda K $ to $ H_1 $, then the volume is $ frac {1} {d} in ^ d $, where $ a $ is a constant depends on $ u $.

    I mean, in general, it is very difficult to calculate the volume of capitals defined in a similar way to $ K $. But if we explode $ K $, some factors can be ignored when $ lambda $ It's big enough, so I hope there's a limit to the size of the lid volume.

    insurance: if I pay a rental car with points and the credit card only covers taxes and deposits, is the CDW card valid?

    I recently rented a car in the USA. UU That I paid with Enterprise points. I usually reject the CDW because my Chase card covers it when I pay. But when paying with points, the "rent" is not charged on the card, only the tax and the deposit. In the Benefits Guide, write that the condition for coverage is "Start and complete the full rental transaction using your card that is eligible for the benefit." Which is the case, except that the rental transaction does not include the cost of the rent, because it is covered by points. Does anyone know how credit card companies treat these types of cases?