Failed to execute 'scroll' on 'Window': 2 arguments required, but only 1 present

RILEYW1

I have a code from here, but it gives me a error.

Uncaught TypeError: Failed to execute 'scroll' on 'Window': 2 arguments required, but only 1 present.

I have jQuery 1.8.3 installed, and script is on bottom of page. Code:

<script type='text/javascript'>
    $(window).scroll(function() {    
        var scroll = $(window).scrollTop();

        if (scroll >= 150) {
            $(".navigation").addClass("darkHeader");
        } else {
            $(".navigation").removeClass("darkHeader");
        }
    });
    </script>

Any help? On jsfiddle everything working. Code is on IPBoard 3.4.8.

Mohamed Mohamed

use

  $(document).ready(function(){ 

   }

to get element after document ready

here the demo

Click here!

update demo for notice the change of scroll

Click here!

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Failed to execute 'createOffer' on 'RTCPeerConnection': 2 arguments required, but only 0 present

From Dev

Failed to execute 'createOffer' on 'RTCPeerConnection': 2 arguments required, but only 0 present

From Dev

Uncaught TypeError: 1 argument required, but only 0 present...But my function takes no arguments?

From Dev

Failed to execute 'atob' on 'Window'

From Dev

Failed to execute 'requestAnimationFrame' on 'Window': The callback provided as parameter 1 is not a function.

From Dev

Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'

From Dev

Nose required 2 arguments

From Java

Failed to execute 'postMessage' on 'Window' GoogleTagManager

From Dev

FindById is returning 2 results when only 1 is Present

From Dev

Center only 1 image when 2 images present in a div

From Dev

window scroll only one fire

From Dev

Ruby Regular Expression: 1-2 digits required after period if period is present

From Dev

Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.

From Dev

Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element' - Angular / Ionic kendo-chart

From Dev

I want to execute groovy script (present on a server1 ) on server2 which is not having groovy installed in it

From Java

Uncaught DOMException: Failed to execute 'postMessage' on 'Window'

From Dev

InvalidCharacterError: Failed to execute 'atob' on 'Window' PDF file

From Dev

Racket - Check-expect: expects 2 arguments, but found only 1

From Dev

TypeError: overlaps() missing 3 required positional arguments: 'y1', 'x2', and 'y2'

From Dev

$(window).scroll function do only one time

From Dev

Only the topmost code in $(window).scroll is working

From Dev

Error "Uncaught TypeError: Failed to execute 'animate' on 'Element': Valid arities are: [1], but 4 arguments provided." on dynamic input field

From Java

Appending rows only if a row's ID value in df1 is also present in df2

From Dev

Present 2 viewcontrollers but only one transition

From Dev

Present 2 viewcontrollers but only one transition

From Dev

btrfs replace on RAID1 is super slow with failed disk present

From Dev

How do I delete lines of 1st file if it ONLY EXACT Matche of the string present in the 2nd file in linux?

From Dev

Adding overflow: scroll only when the window size is 1366 * 768 and below

From Dev

Angular 2 - Execute code when closing window

Related Related

  1. 1

    Failed to execute 'createOffer' on 'RTCPeerConnection': 2 arguments required, but only 0 present

  2. 2

    Failed to execute 'createOffer' on 'RTCPeerConnection': 2 arguments required, but only 0 present

  3. 3

    Uncaught TypeError: 1 argument required, but only 0 present...But my function takes no arguments?

  4. 4

    Failed to execute 'atob' on 'Window'

  5. 5

    Failed to execute 'requestAnimationFrame' on 'Window': The callback provided as parameter 1 is not a function.

  6. 6

    Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'

  7. 7

    Nose required 2 arguments

  8. 8

    Failed to execute 'postMessage' on 'Window' GoogleTagManager

  9. 9

    FindById is returning 2 results when only 1 is Present

  10. 10

    Center only 1 image when 2 images present in a div

  11. 11

    window scroll only one fire

  12. 12

    Ruby Regular Expression: 1-2 digits required after period if period is present

  13. 13

    Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.

  14. 14

    Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element' - Angular / Ionic kendo-chart

  15. 15

    I want to execute groovy script (present on a server1 ) on server2 which is not having groovy installed in it

  16. 16

    Uncaught DOMException: Failed to execute 'postMessage' on 'Window'

  17. 17

    InvalidCharacterError: Failed to execute 'atob' on 'Window' PDF file

  18. 18

    Racket - Check-expect: expects 2 arguments, but found only 1

  19. 19

    TypeError: overlaps() missing 3 required positional arguments: 'y1', 'x2', and 'y2'

  20. 20

    $(window).scroll function do only one time

  21. 21

    Only the topmost code in $(window).scroll is working

  22. 22

    Error "Uncaught TypeError: Failed to execute 'animate' on 'Element': Valid arities are: [1], but 4 arguments provided." on dynamic input field

  23. 23

    Appending rows only if a row's ID value in df1 is also present in df2

  24. 24

    Present 2 viewcontrollers but only one transition

  25. 25

    Present 2 viewcontrollers but only one transition

  26. 26

    btrfs replace on RAID1 is super slow with failed disk present

  27. 27

    How do I delete lines of 1st file if it ONLY EXACT Matche of the string present in the 2nd file in linux?

  28. 28

    Adding overflow: scroll only when the window size is 1366 * 768 and below

  29. 29

    Angular 2 - Execute code when closing window

HotTag

Archive