-1

Could someone say what the matter is? At first I have load jQuery Waypoints (http://imakewebthings.github.com/jquery-waypoints/) then included the code you could see after the text. I need fadeIn effect on images when scrolling down the page but nothing heppen at all. I found this solution here at Stack Overflow - JQuery fade-in a div when user scrolls to that div And here is the link where I am trying to do my solution - http://layot.prestatrend.com Thanks!

// by default your element will be hidden
$('.ajax_block_product').hide();
// call waypoint plugin
$('.ajax_block_product').waypoint(function(event, direction) {
    // do your fade in here
    $(this).fadeIn();
}, {
   offset: function() {
       // The bottom of the element is in view
       return $.waypoints('viewportHeight') - $(this).outerHeight();
    }
});
Community
  • 1
  • 1
Anton
  • 75
  • 1
  • 4
  • 12
  • Did you forget to paste in the code? – JJJ Feb 05 '12 at 20:26
  • You've supplied very little in terms of actual information to help you. We could look at plug in pages, past questions, and jquery references forever and never even come close to guessing what's wrong with **your** code. – Scott Feb 05 '12 at 20:30
  • Try the following, it should work. – Dave Newton Feb 05 '12 at 20:30
  • No, I could not. Sorry... Your post appears to contain code that is not properly formatted as code. Please indent all code by 4 spaces using the code toolbar button or the CTRL+K keyboard shortcut. I do but this error do not disappears. – Anton Feb 05 '12 at 20:30
  • @Anton Then try again; everyone else can post code. – Dave Newton Feb 05 '12 at 20:31
  • I have updated my post with code. See, please... – Anton Feb 05 '12 at 20:45
  • Hm, I see my code work but not I need exactly. It is fadeIn images when page is loading but no fadeIn effect when scroll down the page... – Anton Feb 05 '12 at 20:52

1 Answers1

0

The jQuery hide function sets display:none on an element. Elements with display:none don't report the correct offset. Try initially setting the opacity to 0 or visibility to hidden instead.

imakewebthings
  • 3,388
  • 1
  • 23
  • 18