Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8036349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:35:26+00:00 2026-06-05T02:35:26+00:00

I have a problem and it’s giving me headaches since I started looking for

  • 0

I have a problem and it’s giving me headaches since I started looking for it yesterday.

I have a couple of jQuery scripts and my page includes .load jQuery ajax (at the bottom of the page).

I use a hover effect for the images and a fixed position of the header that is located in js/tools.js

The problem is that, randomly my browsers won’t load the tools.js into the ajax. So sometimes you don’t see the image hover effect in the loaded ajax content. When refreshing the page it woks fine.

My first bet was that the scripts I use collide or that there’s a problem with the order in which the content or the .js loads.

js:

$(document).ready(function() {
    $('.cta-btn, .portf1, .portf2, .portf3, .portf4, .portf5, .btn-facebook, .btn-twitter, .btn-linkedin, .btn-studiofacebook, .btn-studiotwitter,.btn-studiolinkedin,.newsitem1, .newsitem2, .newsitem3').append('<span class="hover"></span>').each(function () {
        var $span = $('> span.hover', this).css('opacity', 0);
        $(this).hover(function () {
            $span.stop().fadeTo(200, 1);
        }, function () {
    $span.stop().fadeTo(400, 0);
        });
    });
});

$(function(){
     var stickyHeaderTop = $('#stickyheader').offset().top;

     $(window).scroll(function(){
             if( $(window).scrollTop() > stickyHeaderTop ) {
                     $('#stickyheader').css({position: 'fixed', top: '0px'});
                     $('#stickyalias').css('display', 'block');
             } else {
                     $('#stickyheader').css({position: 'static', top: '0px'});
                     $('#stickyalias').css('display', 'none');
             }
       });   
});

html:

<!-- portfolio -->
<div id="portfoliowrapper">
<div id="portfolioitems"></div>
<script>$("#portfolioitems").load("werk.html #portfolio");</script>
<div class="clear"></div>
<a href="werk.html" class="cta-btn"><h2 class="btn">Werk</h2></a>
</div>

Any ideas? Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:35:28+00:00Added an answer on June 5, 2026 at 2:35 am

    You need to show some code, you can’t expect us to dig through your site.

    It’s very likely that you’re using

    $(function(){
       // code that depends on images being loaded here
    });
    

    However, that will not wait for the images to load, it only waits until the DOM is ready to be modified. The event that waits for images is the load event of the window.

    $(window).load(function(){
       // here all images in the HTML are guaranteed to be loaded
    });
    

    The second time your page is run, the images are in the cache and they are already loaded when the DOM is ready, that is from your $(document).ready() handler

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have problem with jquery submit and post. I would like to submit a
I have problem with Razor syntax and jQuery, I'm trying to append some items
I have problem I have never met before. I was clearing yesterday clients db
I have problem with customizing each page using pagecontrol and UIScrollView. I'm customizing Page
I have problem calling a JavaScript function in an iframe from the parent page.
I have problem with my own Subversion repository. It worked yesterday. But I received
I have problem to put several countdowns on page. I use HTML.Partial: <span><strong id=time_h></strong>godz.
I have problem with UIWebView delay when the load image from url. In my
I have problem with consuming DbContext class in EF 4.3 CodeFirst approach. As for
I have problem with building in Qt4 creator. I have some created projects and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.