Javascript Parallax Effect Explained

  Рет қаралды 50,694

optikalefx

optikalefx

Күн бұрын

Пікірлер: 180
@bennettwaisbren
@bennettwaisbren 9 жыл бұрын
LOOOL I was scratching my head so hard when you accidentally added those straggling classes sitting outside of the quotes.
@luvitluvitbaby
@luvitluvitbaby 9 жыл бұрын
YOU ARE A LIFESAVER!!!! THANKYOU!!!!! I am junior developer and I have been pulling my hair out trying to get this effect!!! It took awhile, but I finally got it! You are Godsend!!!!
@6Sloth9
@6Sloth9 11 жыл бұрын
Welcome back Sean! Missed your videos.
@trzown
@trzown 11 жыл бұрын
Dang dude I don't even f with development stuff anymore but i ended up watching because you speak so well and its fun to listen! Good job!
@optikalefx
@optikalefx 11 жыл бұрын
Yea you can, but using ANYTHING except transforms will cause the browser to do a re-render of the screen every frame, which will be slow. Transforms can be done in the GPU and thus be fast. I'm making a part 2 to explain that soon.
@optikalefx
@optikalefx 11 жыл бұрын
coming soon!
@theinterworks
@theinterworks 9 жыл бұрын
I can not tell you how much this helped me. Totally brought my website to life! Thank you so much for taking the time to actually step through the code, and for leaving in the mess ups. The real world involves snags, not all code is going to work perfectly the first time, and this encouraged me to keep at it, which exponentially paid off.
@optikalefx
@optikalefx 10 жыл бұрын
Mark Enriquez You had a line break in your div.style part. Once that is fixed then you don't have an error anymore. Try this on a page by itself, not in JS fiddle.
@MrRossahlvin
@MrRossahlvin 10 жыл бұрын
Hey there, I am very new to this, and know the basics of the basic. I do grasp the general concept of it and this is by far the best video I have found. But If I am wanting to do this similar effect for my own portfolio website. I would have a different src under script correct? @ 1:28. Sorry for the nooby question but I do like to learn a lot of how this stuff works. Helps my design. Thanks for the video though it so far is more informative then blogs and others alike
@tubetlamber
@tubetlamber 11 жыл бұрын
Well done. This puts the other parallax tutorials to shame. :)
@MiguelBillietMusic
@MiguelBillietMusic 11 жыл бұрын
on 1:15 i can't see the adress of the src in the script. can i get it?
@optikalefx
@optikalefx 11 жыл бұрын
I don't make the code available. The goal is that you learn and type it yourself. Just the mere act of typing it out will do wonders for you understanding how it works.
@abdullahislam
@abdullahislam 11 жыл бұрын
Man! Its been a long time!
@ajgubi19
@ajgubi19 11 жыл бұрын
absolutely awesome! Hey! Paul Irish fan here too! :D
@Hiyop
@Hiyop 10 жыл бұрын
sadly i had to stop @ 1:14 because of jquery. You should mention this in either the title or description. This will save real Javascript programmers at least 1:14 of their life-time.
@optikalefx
@optikalefx 10 жыл бұрын
You should have kept watching to part two. jQuery was used to show off how inefficient it's loops are. In part 2 we use native for loops to show how to optimize these kinds of things. And to your hearts desire in part 2 you can use querySelectorAll instead of .find
@Hiyop
@Hiyop 10 жыл бұрын
optikalefx thanks for quick reply. i'll have a look soon.
@john-michaelsmith
@john-michaelsmith 11 жыл бұрын
I didn't do something right, but I don't know where. I've been on this video for over an hour trying to figure it out.. But so far, this is the best tutorial I've seen. I just messed up somewhere.
@optikalefx
@optikalefx 11 жыл бұрын
Whats you're debug console have to say about all this?
@john-michaelsmith
@john-michaelsmith 11 жыл бұрын
optikalefx I'm just using notepad++, so there is no built in debug.
@optikalefx
@optikalefx 11 жыл бұрын
John-Michael Smith I mean the chrome dev tools. When you run it in the browser, open the console and see what it tells you
@john-michaelsmith
@john-michaelsmith 11 жыл бұрын
optikalefx Under errors it says, "uncaught ReferenceError: $div is not defined"
@optikalefx
@optikalefx 11 жыл бұрын
John-Michael Smith BOOM there's your problem. You're trying to use the variable $div without every have set it.
@areefahmed8141
@areefahmed8141 10 жыл бұрын
You shud get paid for all your tutorials man...they are great...until then subscribing ;)
@wojna1234
@wojna1234 11 жыл бұрын
Could you use something else than webkit translate 3d? Maybe changing position of each image givs the same effect?
@ericadreisbach9754
@ericadreisbach9754 10 жыл бұрын
You are awesome. This is awesome. Thank you, brother.
@optikalefx
@optikalefx 10 жыл бұрын
Pleasure is all mine.
@gkiokan
@gkiokan 11 жыл бұрын
Thats really great, thats imba thats awsome. Good job dude, this inspirates me for some new actions also. How about getting 3d Animation like swipe left / right on scroll while scrolling. Thats the beginning of a new Dimension :)
@optikalefx
@optikalefx 11 жыл бұрын
Thanks. You mean like as the user is scrolling you want the parallax to move in an X direction?
@gkiokan
@gkiokan 11 жыл бұрын
Not really, i thought more like opening a window Effekt. Means it flips left / right or something like this. Hard to explain. But well with the Differents calulation we can use any effekts later on.
@sdhpCH
@sdhpCH 11 жыл бұрын
I love the effect and the performance, but please help us out with bringing that into the other major browsers... i tried a lot of things now, but FF and IE does not work with "translate"...
@LilLaura25
@LilLaura25 11 жыл бұрын
Hi there! I have no errors in the console left and it still doesnt work. Any other reasons why it might not work that is not code related?? :) Questions aside, liked the explanations in this tutorial a lot!! Thanks.
@optikalefx
@optikalefx 11 жыл бұрын
I actually love the windows 8 style. Call me a sinner.
@areefahmed8141
@areefahmed8141 10 жыл бұрын
SUPERB !!! this is exactly what I was looking for !!! thanks a bunch mate!! and good job! (Y) :D
@kneckel
@kneckel 11 жыл бұрын
really good job, I understood everything... and even made one myself... nice...!
@ipraveen021
@ipraveen021 10 жыл бұрын
thanks a lot and I saw the second video too, it really had good info on efficiency and I learned a lot!
@Stacey-gi8pu
@Stacey-gi8pu 10 жыл бұрын
Is there at least a place we can get the images used so we can follow the tutorial correctly?
@ghousepasha3297
@ghousepasha3297 10 жыл бұрын
Thanks for the great video! But I am unable to see the text which i have added to display on top of image. Thanks
@rajeshnobojja4007
@rajeshnobojja4007 10 жыл бұрын
hello,i liked this video pretty much i am making website using parallax,in that an object (raw diamond) is falling down and breaking into pieces(pure diamond) using parallax scroll the whole thing should work. so i just want to know the possible way to create and also how much images do i required
@ulamlangbinary7694
@ulamlangbinary7694 11 жыл бұрын
Last question sir!! How did you separate those sample text within each picture? All I can do is they overlap each other >.
@lindam9848
@lindam9848 11 жыл бұрын
it works, finally. Great Thanks
@Botchy1997
@Botchy1997 10 жыл бұрын
is there anywhere that i can get the images used in this tutorial? A quick reply would be awesome, Thanks!
@optikalefx
@optikalefx 10 жыл бұрын
Here's 2 of em cl.ly/0S3Q1n0p3H2z
@kitboschert7447
@kitboschert7447 10 жыл бұрын
optikalefx thanks
@pmuruaga
@pmuruaga 10 жыл бұрын
Uncaught ReferenceError: JQuery is not defined. Why am I getting this message on the console in Chrome? If I use this: "jQuery(document).ready(function($) {" instead of "(function($){". Seems better, but not sure if is correct to change it.
@optikalefx
@optikalefx 10 жыл бұрын
you can change it. You probably have the parenthesis wrong for the other way. No biggie. It's more of a super advanced JS thing to do it the other way. It protects your code from interfering with lots of 3rd party code
@thisguythatguy123
@thisguythatguy123 11 жыл бұрын
my background images dont seem to be stacking on top of each other. Only shows the first div. Anybody know why or what im doing wrong?
@optikalefx
@optikalefx 11 жыл бұрын
Sounds like a positioning CSS problem. If your divs are straight DIVs then they will stack.
@linkpark182
@linkpark182 11 жыл бұрын
optikalefx, thanks for the tutorial, i really like the way that explains and I'm will subscribe
@atbaojq
@atbaojq 10 жыл бұрын
cool tutorial. it runs perfectly in my chrome36, but in FF31 and IE11, it looks not working. are there some ways to make it run in FF and IE11? Thanks
@milibrodeoro
@milibrodeoro 8 жыл бұрын
Thank you for a great video. The onlly thing I didn't manage was the requestAnimationFrame. so I uses the setInterval(function () { render(); }, 1000 / 60) It worked fine. /A
@pshermantech
@pshermantech 10 жыл бұрын
Why are you using $ for some variables?
@wojna1234
@wojna1234 11 жыл бұрын
You are right. I see it now. Thanks
@kbkrisa
@kbkrisa 11 жыл бұрын
Hey, really nice tutorial, although it doesn't work for me :/ JavaScript Console shows no error, and there is no syntax error in the code either. I tried to write this code 3 times or more already, i also tried your part 2 tutorial, maybe with that it'd work but it won't and I just don't know what the problem could be. Can you help me somehow, it's really frustrating? Thanks
@optikalefx
@optikalefx 11 жыл бұрын
Send me your code sean@square-bracket.com
@sarinabodker8543
@sarinabodker8543 11 жыл бұрын
I want to change the height of the pictures, so that each picture fills the screen when scrolling. But every time I get it right, it starts trembling (shaking) alot! How do I fix this problem? And what makes it shake?
@optikalefx
@optikalefx 11 жыл бұрын
That would be the Harlem Shake. It's back.
@optikalefx
@optikalefx 11 жыл бұрын
Is your code up online that I can see? Or you can send me the files to take a look.
@sarinabodker8543
@sarinabodker8543 11 жыл бұрын
I just put it online :) www.sarinabodker.dk Is the Harlem Shake normal?
@optikalefx
@optikalefx 11 жыл бұрын
Sarina Bodker Try changing Math.round to Math.floor
@sarinabodker8543
@sarinabodker8543 11 жыл бұрын
optikalefx It is still the same :(
@HaeriStudios
@HaeriStudios 11 жыл бұрын
Very nice tutorial. Could you post the code somewhere so that we can follow along easier? Would be great! PS: Yesterday I made a simple timed image-slider... Now I am embarrassed, because your parallax page runs faster than my shitty slider :/
@optikalefx
@optikalefx 11 жыл бұрын
Haha thanks! All of the code should be there in the video, if I just gave you the code then you wouldn't need to learn it. :) Best of luck!
@matteofadi3923
@matteofadi3923 10 жыл бұрын
Fantastic! i have only one problem ... chrome dev tools don't give me any error... but i can't see java working ... but i've this problem since i've start to write down your code . For example, the count test doesn't work for me ... do you know why ? Thanks man ... and thanks twice for answering the question of users ! :D
@optikalefx
@optikalefx 10 жыл бұрын
Put your code up somewhere so i can take a look
@matteofadi3923
@matteofadi3923 10 жыл бұрын
optikalefx here it is ! pastebin.com/zSsHQzV2
@matteofadi3923
@matteofadi3923 10 жыл бұрын
Problem found. for(i=0,len=$divs.lenght;i
@optikalefx
@optikalefx 10 жыл бұрын
Matteo Fadi Woo!!
@OtepArc
@OtepArc 10 жыл бұрын
also wrong spelling of length typing error you type "lenght"
@sorabhanand3107
@sorabhanand3107 10 жыл бұрын
what drawing software is that?
@optikalefx
@optikalefx 10 жыл бұрын
That's balsamiq mockups
@sorabhanand3107
@sorabhanand3107 10 жыл бұрын
thanks :) I like ur tutorials bro :)
@ulamlangbinary7694
@ulamlangbinary7694 11 жыл бұрын
can i make this in Notepad? I did every step.. but still no window :( the picture doesnt move.
@jethroabarquez2915
@jethroabarquez2915 11 жыл бұрын
is there any way that this parallax works on firefox? it works on chrome but not in firefox please help me
@optikalefx
@optikalefx 11 жыл бұрын
Probably yes, but I'll have to investigate what firefox isn't supporting. Ill let you know when I can do that
@jethroabarquez2915
@jethroabarquez2915 11 жыл бұрын
optikalefx sir do you have any updates about firefox?
@optikalefx
@optikalefx 11 жыл бұрын
jethro abarquez not yet! Sorry guys, just super busy :/
@pardeepshergill17
@pardeepshergill17 11 жыл бұрын
Can i get the code of this example ?
@optikalefx
@optikalefx 11 жыл бұрын
I normally don't give out the code, because then you have the option to just copy instead of actually learn it. Try it yourself, if you can't figure it out, ask some questions.
@pardeepshergill17
@pardeepshergill17 11 жыл бұрын
i have implement the code. But am not able to see the effects like your page was had .
@optikalefx
@optikalefx 11 жыл бұрын
Pardeep Shergill Sounds like you have some errors. Have you checked the Chrome Console or Firebug to see what errors you have?
@pardeepshergill17
@pardeepshergill17 11 жыл бұрын
optikalefx Got following errors Uncaught TypeError: Cannot read property 'parentNode' of undefined index.html:71 render index.html:71 loop index.html:82 (anonymous function) index.html:83 (anonymous function)
@optikalefx
@optikalefx 11 жыл бұрын
Pardeep Shergill Well there you go. You're trying to get "parentNode" of an element that doesn't exist. Start by looking at line 71 and find parentNode. Then look at what your calling it on and see why it doesn't exist.
@optikalefx
@optikalefx 11 жыл бұрын
amen!
@Isuimi
@Isuimi 11 жыл бұрын
Hi! Your explanation helped me a lot. (Thank you!) I'd like to ask if there is a way to control the speed when I'm scrolling with the mouse, to make the movement of the images take a little bit longer to take the desired position... I don't know if I'm talking nonsense, the thing is that I saw this page: www.loisjeans.com/web2012/en and the images move not so abruptly with each mouse wheel scroll. (I'm sorry if I'm asking too much or if the explanation is too complicated, is just that this tutorial was really clear... so thank you!)
@optikalefx
@optikalefx 11 жыл бұрын
So in the part where it says Calculate the amount to scroll, you can adjust that by some multiplier to speed up or slow down the scroll. Try playing with a .2 or .8 multiplier to see what happens.
@mrastrogastro
@mrastrogastro 11 жыл бұрын
Try to combine it with greensock.js, it gives just great results! :) Check this! www.websnap.cl/samples/parallax/
@MarshalJose1
@MarshalJose1 10 жыл бұрын
Thank you so much
@richallan480
@richallan480 10 жыл бұрын
Thank you..
@darkmarv95
@darkmarv95 11 жыл бұрын
Really good tutorial! My script isn't working though. Console says: TypeError: thingBeingScrolled is null I don't really know what I should do now
@optikalefx
@optikalefx 11 жыл бұрын
Try changing thingBeingScrolled = document.body
@MrRossahlvin
@MrRossahlvin 10 жыл бұрын
Hey there again: So the divs seem to in place fine but my source images aren't showing up. I am trying to link via a folder on desktop not a url. Does that matter? thanks again here is my coed thus far. "
@areefahmed8141
@areefahmed8141 10 жыл бұрын
hey i got the codes down ..but the parallax effect is not working for me ...and when I check it with the console it does not show any problems... can you please take a look at my code parallax tryout body { margin:0; padding:0; } ul { margin:0; padding:0; } ul li { list-style:none; overflow:hidden; hight:600px; position:relative; } .parallax-background { height: 700px; } .flower { background-image:url(Images/Emergency.jpg); background-position:50% 66%; } .lens { background-image:url(Images/Police.jpeg); background-position:86% 50%; } .beach { background-image:url(Images/Fire.jpg); background-position:35% 66%; } .wolf { background-image:url(Images/Ambulance.jpg); background-position: 20% 23% } ul li .subcontent { position:absolute; top:100px; left:100px; color:white; font-family:Impact; } h1 { font-size:100px; margin-bottom:0px; } h2 { font-size:60px; margin-top:0px; } Sample Text Hey there Sample Text Hey there Sample Text Hey there Sample Text Hey there (function($) { var $container = $(".parallax"); var $divs = $container.find("div.parallax-background"); var thingBeingScrolled = document.body; var liHeight = $divs.eq(0).closest("li").height(); var diffHeight= $divs.eq(0).height() - liHeight; var i,len,div,li,offset,scroll,top; var render = function() { // thing were scrolling top = thingBeingScrolled.scrollTop; //loop through divs for(i=0,len=$divs.length;i
@areefahmed8141
@areefahmed8141 10 жыл бұрын
can you please check my code and tell me where is it wrong ? ...will be a great help
@gravics
@gravics 11 жыл бұрын
That's very cool.
@ezay122
@ezay122 10 жыл бұрын
Is you script open source ???
@optikalefx
@optikalefx 10 жыл бұрын
This isn't a script or a plugin. It's a training video on how to do this kind of thing. It's not meant to be 'dropped in'
@ezay122
@ezay122 10 жыл бұрын
Yes i know. Great tutorial.
@ezay122
@ezay122 10 жыл бұрын
optikalefx one question I have yet, where is the error??? body{ margin:0; padding:0; } ul{ margin:0; padding:0; } ul li{ list-style:none; overflow:hidden; height:600px; } .prallax-background{ height:700px; } .bild1{ background-image:url("test11.png"); } .bild2{ background-image:url('test11.png'); } .bild3{ background-image:url("test11.png"); }
@ezay122
@ezay122 10 жыл бұрын
ok I fix it :)
@eliab2429
@eliab2429 10 жыл бұрын
Ayuda, me muestra este error en la consola, en Chrome, Mozilla en todos los navegadores. Failed to load resource: net::ERR_FILE_NOT_FOUND file://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js Uncaught SyntaxError: Unexpected token ILLEGAL
@optikalefx
@optikalefx 10 жыл бұрын
Hola! use ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js instead
@alexgraph799
@alexgraph799 10 жыл бұрын
Hi everything is cool just that doesn't work for me:( can you send the project files, JS, CSS,IMG and index.html files thanx
@optikalefx
@optikalefx 10 жыл бұрын
doesn't sound cool to me, what errors do you get in console? Did you add some logging to see how far the code is getting vs not getting?
@alexgraph799
@alexgraph799 10 жыл бұрын
optikalefx I am trying to create my page without any template... i foloved your tutoriel but at the end thats shows only 4 images no annimation... i am a begginer at this thing... i did it in Dw and in chrome i didnt get errors only one by inspect elements, but dond know what... i did a index page and a img folder, i recopied page styles to a new doc style.css in a new folder css thats all i did after that i create a js folder ...thats all ... and still see only 4 images no animation
@optikalefx
@optikalefx 10 жыл бұрын
alex Graph zip up your project and send it over to me sean@square-bracket.com
@alexgraph799
@alexgraph799 10 жыл бұрын
ok will do it ... iam trying from 0
@aleksejspridannikovs8722
@aleksejspridannikovs8722 10 жыл бұрын
optikalefx i have sand you a mail... from alex.demolliens@gmail.com
@timothytong9169
@timothytong9169 10 жыл бұрын
optikalefx I don't know why but I just keep getting this error "Cannot Read Property "scrollTop" of null?? I compared everything to your code and the only difference is one of the variable names.. Please help me out? Many thanks! pastebin.com/NRhJLUNj
@timothytong9169
@timothytong9169 10 жыл бұрын
Oh I found the problem! I was supposed to put the entire snippet AFTER the html because the DOM reads everything in sequence!!
@ulamlangbinary7694
@ulamlangbinary7694 11 жыл бұрын
Nevermind Fixed it XD
@diegocastro4594
@diegocastro4594 11 жыл бұрын
Didn't work X_x but i think i probablly did something wrong, i did'nt write de code down the body part but in another .js sheet, i'm not so advanced on this so i think i wrotte something were i shouldn't have X_x
@optikalefx
@optikalefx 11 жыл бұрын
drunk !== high
@MiguelBillietMusic
@MiguelBillietMusic 11 жыл бұрын
i dont have the effect, and also no error in the console
@optikalefx
@optikalefx 11 жыл бұрын
Time to go back and review the code. You can send it my way if you want me to look at it.
@MiguelBillietMusic
@MiguelBillietMusic 11 жыл бұрын
optikalefx sended my code to your email. dont know how to send a message to each other since i have google + -_-
@optikalefx
@optikalefx 11 жыл бұрын
Thanks for sending your code. You had 2 problems. 1) you wrote this "$divs.eq(0).height" which doesn't work. Height is a function, not a property, you need height(); 2nd) you never defined the variable "top" inside the render loop. Once those are both added I've got your code working.
@MiguelBillietMusic
@MiguelBillietMusic 11 жыл бұрын
optikalefx Thanks it worked :) Subscribed.
@yousram8890
@yousram8890 10 жыл бұрын
Hello~~! The video was amazing and your explanation was pretty easy but I can't seem to make the effect work for me and I really don't why. I really need your help in this because I'm doing it for my project in university and am planning on using parallax scrolling for my website .. I sent you an email with a zip file of my code, hope you'll find the time to check it, thank you
@yousram8890
@yousram8890 10 жыл бұрын
I tried it again with the whole code in one sheet and it worked just fine! But I need to use the css and js in external sheets not embedded style.. I checked my links for css and js in the index.html and it's correct! I don't know what's the problem >.
@optikalefx
@optikalefx 10 жыл бұрын
Yousra M 1) Your spacing is like non-existent. 2) You never closed the (function() { with a })(); 3) You never included jQuery 4) you spelled requestAnimationframe wrong in the loop, it should have a capital F 5) you need to load your JS at the end of your file, not the top
@yousram8890
@yousram8890 10 жыл бұрын
optikalefx 1) Sorry but what do you mean by spacing? 3) How to include jQuery? 5) You mean in the index.file I should put the js file in the ? .. thank you for replaying
@yousram8890
@yousram8890 10 жыл бұрын
Yousra M Ok it worked after I included the jQuery and fixed the loop and closed the function. Thank you so much for your help, but can you tell me what you meant by spacing?
@optikalefx
@optikalefx 10 жыл бұрын
Yousra M Sure, so here is a screenshot of the file you sent me cl.ly/image/2J351e2e1O1A Everything is lined up to the left edge. There are no tabs or indentations.
@NickolasKusha
@NickolasKusha 10 жыл бұрын
cool man )
@JamesRCoston
@JamesRCoston 11 жыл бұрын
Nothing like being high and coding.
@TechXSoftware
@TechXSoftware 11 жыл бұрын
looks cool, but it reminds me of windows 8 :(
@renboy94
@renboy94 10 жыл бұрын
Hi, thank you for this parallax tutorial. However, I am having problems with my code. The console says Uncaught SyntaxError: Unexpected token ; at line 114. It would be great if someone could help: pastebin.com/p5YVMevM
@optikalefx
@optikalefx 10 жыл бұрын
You have a syntax error on line 114. })(jQuery(); Notice the open parenthesis that doesn't close? In the video we end with })(jQuery);
@renboy94
@renboy94 10 жыл бұрын
optikalefx Hi, I have tried it and the error went away but I still can't seem to make it work?
@renboy94
@renboy94 10 жыл бұрын
renboy94 Nevermind, I compared my code with the other's and fixed the bug. Thank you once again!
@leobobo1
@leobobo1 10 жыл бұрын
Thank you so much for making this. One problem is I keep getting "Uncaught ReferenceError: $div is not defined". I am a JavaScript newbie, can anyone please let me know where did I mess it up? pastebin.com/VC08WKvz
@optikalefx
@optikalefx 10 жыл бұрын
Line 67, you refer to $div instead of $divs. You do that in a few places. You define the variable $divs above, make sure you pay close attention to those "s"s
@leobobo1
@leobobo1 10 жыл бұрын
optikalefx Thank you =)
@ransombot
@ransombot 11 жыл бұрын
if ((drunk || high) >= life) {return} else {return wakeUp}
@fahadahaf
@fahadahaf 10 жыл бұрын
optikalefx use emmet for christ's sake. you are spending too much time writing arbitrary markup
@reginameyer3308
@reginameyer3308 9 жыл бұрын
Brilliant videos - very well explained. Thanks so much ! It works fine in chrome, but what ever I try, it wont run properly in mozilla firefox. Someone has an idea which part is wrong ? jsfiddle.net/gingin/pcsmnudy/
@optikalefx
@optikalefx 9 жыл бұрын
Regina Meyer The firefox debugger sucks so I can't spend a lot of time figuring it out. However the problem is that in Firefox document.body.scrollTop is not giving a scroll position. Feel free to debug that in the console, but that's where you need to check. I'm not sure why it wouldn't give a scroll position, maybe there's a work around bug.
@reginameyer3308
@reginameyer3308 9 жыл бұрын
optikalefx Thanks for your hint. //thing were scrolling top = (document.documentElement || document.body.parentNode || document.body).scrollTop; or better: var thingBeingScrolled = (document.documentElement || document.body.parentNode || document.body); it acually works now !!! in FF heres where I got it from: miketaylr.com/posts/2014/11/document-body-scrollTop.html
@catwif7376
@catwif7376 9 жыл бұрын
There is a problem with the debugger in Mozilla Firefox
This Simple Trick Makes Your Website 83% Better Looking
10:57
Web Dev Simplified
Рет қаралды 403 М.
Javascript Parallax Details Cross Browser and Optimizations
20:01
진짜✅ 아님 가짜❌???
0:21
승비니 Seungbini
Рет қаралды 10 МЛН
🎈🎈🎈😲 #tiktok #shorts
0:28
Byungari 병아리언니
Рет қаралды 4,5 МЛН
Parallax Tutorial using Parallax.JS
21:05
DesignCourse
Рет қаралды 122 М.
AI Is Making You An Illiterate Programmer
27:22
ThePrimeTime
Рет қаралды 289 М.
Learn CSS Positioning Quickly With A Real World Example
8:32
Slaying The Dragon
Рет қаралды 725 М.
5 Hidden Windows Features You Should Be Using in 2025!
8:05
Kevin Stratvert
Рет қаралды 134 М.
Learn CSS Flexbox in 20 Minutes (Course)
20:37
Coding2GO
Рет қаралды 369 М.
What is the Parallax Effect?
3:06
Motionlaz
Рет қаралды 73 М.
Parallax On The Web (Part 2) - Parallax Header
29:18
DevTips
Рет қаралды 235 М.
10 Parallax CSS Website Examples That Will Blow Your Mind
2:36
GraphicMama
Рет қаралды 6 М.
The Easy Way to Design Top Tier Websites
11:54
Sajid
Рет қаралды 716 М.