Jump to content

Jquery show()


jaymc

Recommended Posts

<script type="text/javascript" src="/lite/cp/js/jquery.js"></script>
<script type="text/javascript">$(document).ready(function(){$('.bann').addClass('clicked');});</script>
<script type="text/javascript" src="/lite/cp/js/plugins.js"></script>
<script type="text/javascript">$(document).ready(function(){$("#page_content_title").show(500);});</script>

 

For some reason when I call $(document).ready(function(){$("#page_content_title").show(500);}); as shown above it works intermittently in chrome upon page refresh. In firefox it never works and in IE it works perfect

 

Im guessing its the order/speed in which the browser is processing, hence it may try and run that code when the #page_content_title div has not been fully registered

 

Any ideas? Anything I can do to test / make it reliably work

Link to comment
https://forums.phpfreaks.com/topic/164834-jquery-show/
Share on other sites

<script type="text/javascript" src="/lite/cp/js/jquery.js"></script>
<script type="text/javascript" src="/lite/cp/js/plugins.js"></script>
<script type="text/javascript">
  $(document).ready(function()
  {
    $('.bann').addClass('clicked');});
    $("#page_content_title").show(500);
  });
</script>

 

Using two document ready calls will confuse some browsers. You need to combine them.

Link to comment
https://forums.phpfreaks.com/topic/164834-jquery-show/#findComment-869265
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.