I have a textarea in a div that I need to call a jquery function on to activate my rich textbox. The div is initially hidden and becomes visible through a button click on the server side:
<div id="RichTextDiv" style="display:none">
<textarea id="RichText" />
</div>
<script type="text/javascript" language="javascript">
$(document).ready(function () {
$("#RichText").markItUp(mySettings);
}
</script>
The above code doesn’t work because RichTextDiv is not visible during page load. I need to perform the markItUp() action on RichText as soon as it becomes visible. How can this be achieved in jquery?
Thanks…
You could just leave it visible initially
and
MarkItUpand hide on readyor wire it up once your button is clicked:
all this said, I don’t know why MarkItUp would only work on visible elements, seems odd