I try to toggle some elements(labels/fields/img) with jQuery based on the jQuery ends with selector.
Everything works fine in IE/Firefox/Safari – but not on Google’s Chrome. There’s an issue with img elements on the document.ready() function.
Chrome does not toggle those img elements.
Any Idea, suggestions? Thank you.
jQuery 1.5.1
Chrome 12.0.742.100
<script type="text/javascript">
$(document).ready(function () {
var v = $('#VNType').val();
if (v == 'equalToVP') {
ToggleVisibility();
}
});
function ToggleVisibility() {
//jquery ends with selector
//hide label/fields/img
$('[id$="VN"]').toggle();
$('[for$="VN"]').toggle();
}
It is probably due to the fact that
readyfires prior to images being loaded. Tryloadinstead and see if it fixes the issue.