0

I have this code for JQuery:-

$('.ro-news-n img').addClass('no-display');
$('.ro-news-n img').one('inview', function() {
$(this).addClass('appear');
});

This code for hide any image in class .ro-news-n and show it when scroll page down.

Its add class no-display for <img> attribute and when scroll its add appear class to show it.

The problem is when open site its add class no-display to <img> attribute. but when scroll its not add appear class to it.

why

user3133976
  • 85
  • 1
  • 2
  • 9

1 Answers1

0

Try this:

$(this).removeClass('no-display').addClass('appear');
ojovirtual
  • 3,332
  • 16
  • 21
  • its same thing not remove 'no-display' – user3133976 Feb 11 '14 at 08:40
  • If that's not working, it will be something related with the event. Try this solution: [http://stackoverflow.com/a/3535028/2979648](http://stackoverflow.com/a/3535028/2979648) – ojovirtual Feb 11 '14 at 08:45
  • how can i put it in my code ??| and i see some site its work in it like this site : `http://theme-sphere.com/smart-mag/` – user3133976 Feb 11 '14 at 09:48
  • 1. go to [https://github.com/morr/jquery.appear](https://github.com/morr/jquery.appear), download "jquery.appear.js" and put it in your code: ``. 2. Use the "appear" event: `$('.ro-news-n img').appear(function() { $(this).removeClass('no-display').addClass('appear');});` 3. Enjoy – ojovirtual Feb 11 '14 at 09:53
  • sorry its still no-display – user3133976 Feb 11 '14 at 11:53
  • Show us more code, show your styles. How is you img tag? – ojovirtual Feb 11 '14 at 11:57