hide div on page load

  • 1
  • Question
  • Updated 1 year ago
  • Answered
I want to hide wrapper from on page load.
Please find the code as below:
(function(skuid){
var $ = skuid.$;
$(document.body).one('pageload',function(){
        
      $(document).ready(function(){    
    alert('page loaded');  // alert to confirm the page is loaded    
    $('wrapperId').hide(); //enter the class or id of the particular html element which you wish to hide. 
});

    });
})(skuid);
I tried lot twist the code but I didn't get result.
Photo of vicky singh

vicky singh

  • 240 Points 100 badge 2x thumb

Posted 1 year ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
do you have to do this with javascript? Is there a way you can use rendering conditions on the wrapper instead?

At the worst, create a ui-only checkbox field defaulted to false, and set rendering conditions on your wrapper based on that field.
Photo of vicky singh

vicky singh

  • 240 Points 100 badge 2x thumb
how can we do on page load? by using j query.
Photo of vicky singh

vicky singh

  • 240 Points 100 badge 2x thumb
can we do by using jquery?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
sure. try this instead:

skuid.$C('wrapperId').element.hide();
(Edited)
Photo of vicky singh

vicky singh

  • 240 Points 100 badge 2x thumb
Thanks a lot @Matt sones it's worked.