If you scroll down the page in the following URL, the ‘share’ div will lock onto the browser:
http://knowyourmeme.com/memes/pizza-is-a-vegetable
I’m assuming they are applying a position: fixed; attribute. How can this be achieved with jQuery?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can find an example below. Basically you attach a function to
window‘sscrollevent and tracescrollTopproperty and if it’s higher than desired threshold you applyposition: fixedand some other css properties.