Combine 2 jquery scripts
- or -
Post a project like this2455
$$
- Posted:
- Proposals: 12
- Remote
- #1633586
- Awarded
Wordpress | PHP | JavaScript | SEO | MySQL | jQuery | CSS3 | SASS | Node js
Oxford
3367261179661601804524374558555097355543449952241319235148027415453071728893
Description
Experience Level: Intermediate
General information for the website: Jquery code for website
Description of requirements/features: I have a sticky navigation div, which sticks to the top of the browser once you start to scroll - this all works fine - it simply adds a class called '.desktop' via jquery.
When you scroll back up the page, it removes the class '.desktop' - again all this works fine.
I then have a second jquery script which detects if the width of the browser is less than 425px.... if it is less than 425px it is supposed to remove the 'desktop' class set in the first script. This part is not working.
So i assume the scripts would need combining to work correctly. This is what i need help with.
My example code is attached, so you can see what its doing and not doing. Simply scroll up and down the page in desktop view and mobile view to see the styles being added in Inspector of Chrome or Firefox, etc...
you'' see that in Mobile view, the 'desktop' style is NOT being removed once you start to scroll down the page.
Extra notes:
Description of requirements/features: I have a sticky navigation div, which sticks to the top of the browser once you start to scroll - this all works fine - it simply adds a class called '.desktop' via jquery.
When you scroll back up the page, it removes the class '.desktop' - again all this works fine.
I then have a second jquery script which detects if the width of the browser is less than 425px.... if it is less than 425px it is supposed to remove the 'desktop' class set in the first script. This part is not working.
So i assume the scripts would need combining to work correctly. This is what i need help with.
My example code is attached, so you can see what its doing and not doing. Simply scroll up and down the page in desktop view and mobile view to see the styles being added in Inspector of Chrome or Firefox, etc...
you'' see that in Mobile view, the 'desktop' style is NOT being removed once you start to scroll down the page.
Extra notes:
Jeremy A.
100% (3)Projects Completed
7
Freelancers worked with
7
Projects awarded
36%
Last project
7 Jul 2017
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies