Is it possible to change a value of a css style after the page has finished loading?
For example I need to change a division that is display:block to display:none after the page has finished loading?
Is this possible in jQuery and if so how do I implement it?
Checkout the ready() event, and the css() method.
Look at the list of possible selectors to see how to target your element.
$(document).ready(function () {
$('selectorForYourElement').css('display', 'none');
});
:gt() selector, or use the slice() method (preferred).
$(document).ready(function () {
$('selectorForYourElement').slice(1).css('display', 'none');
});
Or
$(document).ready(function () {
$('selectorForYourElement:gt(0)').css('display', 'none');
});
$('selector').css({
display: 'none'
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With