javascript - $(window).scrollTop() is not working in safari -
It works fine on Firefox and Chrome, but Safari has some problem. Here's the code.
Function Installer () {var ScrollPoices = $ (Window) .scrollTop (); If (scrollPos == 900) {$ ("(" first_fall "). FadeIn (1000); $ (". Second_fall "). Feedine (2000); $ (". Third_fall "). FadeIn ( 3000);}); }; }
And this is how I said it
$ (document) .ready (function (e) {$ (window) .bind ( 'Scroll', function () {installer ();});});
Many functions work well on a separate page on Safari and Chrome. Here is the code
$ (function () {$ (window) .bind ('scroll', function () {zoomed ();})}} ()); Function zoomed () {var scrollpace = $ (window) .scrollTop (); If (scrollbox> = 500 & amp; scroll grids & lt; = 800) {$ (function () {$ ('# icon_UU'). ({Obscurity: 0}) Chetan; $ ('about_head'). ({Obscurity: 1});}); } Else {$ (function () {$ ('about_head'). Animate ({obscurity: 0}); $ ('# icon_you'). Animate ({obscurity: 1});}); }; If (scrollbox> = 1100 & scroll grind & lt; = 1500) {$ (function () {$ ('about_company_head'). Animate ({obscurity: 1}); $ ('# icon_company') ({Opacity: 0});}); } {{(About 'about_company_head')} Animate ({obscurity: 0}); $ ('# Icon_company') Animate ({opacity: 1});}); }; If (scrollbox> = 1700 & scroll grinds & lt; = 2200) {$ (function () {$ ('about_project_head'). Animate ({obscurity: 1}); $ ('# icon_project') ({Opacity: 0});}); } And {$ (function () {$ ('about_project_head'). Animate ({obscurity: 0}); $ ('# icon_project'). ({Obscurity: 1})}};}; if (scrollpoint> ; = 2700 & SCROLL POS & lt; 3200) {$ (function () ($ ('practical_head about'). Animate ({obscurity: 1}); $ ('# icon_practical'). {Fuzzy: 0});}); } And {$ (function () {$ ('about_practical_head'). Animate ({obscurity: 0}); $ ('# icon_practical'). ({Obscurity: 1}}}}}}}
< / Pre>
Try
var scrollPos = $ ("body"). ScrollTop ();
WebKit browsers always present window / html scrolltops as zero.
Comments
Post a Comment