Reputation: 44605
I have a div on a page. I want to with jquery, when the div loads a function is fired and I can alter its style based on a set of conditions. Any help with this?
Upvotes: 0
Views: 339
Reputation: 1337
well you could try
<div>...content...</div>
<script>functionToRunWhenDivIsLoaded()</script>
Upvotes: 0
Reputation: 33658
The usual way is to do this, when the DOM is ready.
Put this somewhere in a <script>
:
$(function() {
$('#id_of_div').css({...});
});
Upvotes: 1