Advertisement
fauzanjeg

Custom Sticky for Share Button

Sep 30th, 2021
695
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.46 KB | None | 0 0
  1. /* Custom Sticky for Share Button */
  2. (function ($) {
  3.     var temp = 0;
  4.     $(window).scroll(function () {
  5.         if ($('.jeg_custom_content_wrapper .jeg_share_button').offset().top !== temp) {
  6.             $('.jeg_custom_content_wrapper .jeg_share_button').addClass("custom_sticky");
  7.         }
  8.         else {
  9.             $('.jeg_custom_content_wrapper .jeg_share_button').removeClass("custom_sticky");
  10.         }
  11.         temp = $('.jeg_custom_content_wrapper .jeg_share_button').offset().top;
  12.     });
  13. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement