Guest User

Untitled

a guest
Nov 14th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. (function($) {
  2. $.fn.animated = function(inEffect, outEffect) {
  3. $(this).css("opacity", "0").addClass("animated").waypoint(function(dir) {
  4. if (dir === "down") {
  5. $(this).removeClass(outEffect).addClass(inEffect).css("opacity", "1");
  6. } else {
  7. $(this).removeClass(inEffect).addClass(outEffect).css("opacity", "1");
  8. };
  9. }, {
  10. offset: "80%"
  11. }).waypoint(function(dir) {
  12. if (dir === "down") {
  13. $(this).removeClass(inEffect).addClass(outEffect).css("opacity", "1");
  14. } else {
  15. $(this).removeClass(outEffect).addClass(inEffect).css("opacity", "1");
  16. };
  17. }, {
  18. offset: -$(window).height()
  19. });
  20. };
  21. })(jQuery);
  22.  
  23. (function($) {
  24. $.fn.animated = function(inEffect, outEffect) {
  25. var jQueryObject = $(this);
  26.  
  27. jQueryObject.css("opacity", "0").addClass("animated");
  28.  
  29.  
  30. jQueryObject.waypoint(function(dir) {
  31. if (dir === "down") {
  32. jQueryObject.removeClass(outEffect).addClass(inEffect).css("opacity", "1");
  33. } else {
  34. jQueryObject.removeClass(inEffect).addClass(outEffect).css("opacity", "1");
  35. };
  36. }, {
  37. offset: "80%"
  38. });
  39.  
  40. jQueryObject.waypoint(function(dir) {
  41. if (dir === "down") {
  42. jQueryObject.removeClass(inEffect).addClass(outEffect).css("opacity", "1");
  43. } else {
  44. jQueryObject.removeClass(outEffect).addClass(inEffect).css("opacity", "1");
  45. };
  46. }, {
  47. offset: -$(window).height()
  48. });
  49. };
  50. })(jQuery);
Add Comment
Please, Sign In to add comment