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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.