Jump to content

Jquery auto hide


Craig Hopson

Recommended Posts

Hi guys using this code to hide table contents but how can i make the table hidden on page load

$('.header').click(function () {    var $this = $(this);    $(this).nextUntil('tr.header').slideToggle(100).promise().done(function () {        $this.find('span').text(function (_, value) {            return value == '-' ? '+' : '-'        });    });});

http://jsfiddle.net/y4Mdy/

 

Thanks

Link to comment
Share on other sites

what have you tried? this seems like a very trivial thing, I'm sure there would be plenty of google searches for this...

 

https://www.google.com/search?q=hide+element+on+page+load+jquery&oq=hide+element+on+page+load+jquery&aqs=chrome..69i57j0l3.6532j0&sourceid=chrome&ie=UTF-8

 

 

$(document).ready(function(){  $('.table-selector-here').hide();});
Link to comment
Share on other sites

Thanks for the reply but that does'nt work with my code i dont need to hid a div just the table cells

 

ah, ok. that really wasn't clear from your original post though.

 

 

Hi guys using this code to hide table contents but how can i make the table hidden on page load

Edited by thescientist
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...