+ Start a Discussion
Amish RanjitAmish Ranjit 

Sticky header issue with lightening

I have a JS for sticky header. Somehow, it is not working on salesfroce lightning.
Below is the sample code :
(function(skuid){
    var $ = skuid.$;
    var j$ = jQuery.noConflict();
    $(document.body).one('pageload',function(){
    var j$ = jQuery.noConflict();
    j$(document).ready(function (){
         var navOffset= j$(".scrolling").offset().top;
         console.log(navOffset);
         
         j$(window).scroll(function ()
         {
         
             var scrollPos= j$(window).scrollTop();
             
             console.log(scrollPos);
             if (scrollPos>=navOffset)
             {
                 j$(".scrolling").addClass("fixed");
             }
             else
             {
                 j$(".scrolling").removeClass("fixed");
             }
         });
         
    });
   });
})(skuid);

Would be glad if anyone could help with this.
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Amish Ranjit,

May I suggest you please refer the below link for reference. Hope it will be helpful.

Please mark it as best answer if the information is informative.

Thanks
Rahul Kumar
Amish RanjitAmish Ranjit
Hello Rahul,
             Thank you for the link but that was me posting the question on skuid community as well .:) Do you have any suggestion why its not working on lightening ?