Sunday, 15 January 2012

jquery - Cant get my Javascript to run properly on local machine? -


I am using some javascript which seems to reveal a specific ID when you are able to reach a certain point Scroll, it works and appears when you scroll back up, but it does not remain, but it disappears.

Here's JSField where it works -

And where is it not? -

Before you ask, I have copied the code working from above but it does not work. So if it is a way of working while working in another way, then it should work. Any ideas?

This is also Javascript because it is in my JS file.

  $ (function () {var startY = 300; $ (window) .scroll (function () () () () () () () () () () () () () ) ($ (Window) .scrollTop () Start) {$ ('# sketch-progress, # photoshop-progress, # illustrator-progress, #indus-progress, #css-progress, # html- Progress, #make-progress, # window-progress '). Slide Down ();} and {$ (' # Sketch-Progress, #Photoshop-Progress, # Illustrator- Progress, # Indesin-Progress, # CSS-Progress, # Html- Progress, #Make-Progress, # Window-Progress'). SlideUp ();}} Check Y ();});  

This occurs when it comes back to the Scroll Laughs that I'm having trouble missing anything?

My impression is that To do this, let's take a look at your code.

  $ (define function () {// Height loading bar var starty = 300 should be displayed; // Turn on this function you scroll $ (window) .scroll (function () {checkY ();}); // function is scrolling while function function (check) / If the window position is more than the predetermined height ($ (window) .scrollTop () & gt; StartY) {// Slide all these IDs down $ ('# sketch-progress, #photoshop-progress, # illustrator-progress, # ind-progress, #css-progress, # html-progress, #make-progress, # Window-progress'). Slidedown (); // If the window position is not high then} {// slide all these IDs back to $ ('# sketch-progress, #photoshop - progress, # illustrator-progress, #indus-progress, #css-progress, # Html-progress, # mac-progress, # window-progress'). SlideUp ();}} // Repeat this function again? The scroll function is not really necessary with the check ();});  

tl; Dr As you can see, the else statement in that function removes your loading icon if your statement is not correct, therefore, if you want it to remain and only once appears , What you have to do is remove the else in the if statement.

Was this what you want to know?

  // Try it instead of your original check. Function function check w () {if ($ (window) .scrollTop () startY) {$ ('# sketch-progress, # photoshop-progress, # illustrator-progress, #indus-progress, #css-progress , # Html-progress, # mac-progress, # window-progress'). Slidedown (); }}  

No comments:

Post a Comment