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 4232214
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:03:58+00:00 2026-05-21T02:03:58+00:00

I have this problem: On my home page of a developing WordPress site: http://baksagaspar.com/MH-work/

  • 0

I have this problem:
On my home page of a developing WordPress site: http://baksagaspar.com/MH-work/ I have an animation with this jQuery + jQueryUI(scale) script:

jQuery(function($) {  

// home image set dimensions related to screen size
var Swidth = screen.width;
var imgw = $('#main-back-imghome').width();
var imgh = $('#main-back-imghome').height();
var imgpercent = (imgw / Swidth);
var imgWN = imgw * imgpercent;
var imgHN = imgh * imgpercent;

// now show  
$('#main-back-imghome').css( {width: imgWN, height: imgHN} ).center().hide().delay(1000).show("scale", {}, 3500);

  });  

The problem I have is that when I first visit the page, the animation is not triggering, but on refresh, and after that everything is fine. it is really distracting for the first time visitors to get a complete blank page on first-enter 🙁

My idea was to somehow test if the animation has triggered, and if not – to start it, but maybe that’s not the right way…

Any suggestions how to solve this?

  • 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-05-21T02:03:59+00:00Added an answer on May 21, 2026 at 2:03 am

    I think the animation is triggered but it doesn’t know how big the half megabyte image is when it starts. Everything works fine on refresh because the image is in the browser’s cache by that time.

    In your HTML, you have this:

    <img id="main-back-imghome" src=".." />
    

    Notice that you don’t have width or height attributes. When you do this on the first load:

    var imgw = $('#main-back-imghome').width();
    var imgh = $('#main-back-imghome').height();
    

    The image data won’t be loaded so the width and height will be zero and so imgWN and imgHN will also be zero.

    I’d put width and height attributes on #main-back-imghome and style="display:none;"; then, change the initial .css() call to this:

    $('#main-back-imghome').css({
        width: imgWN,
        height: imgHN,
        display: 'inline-block'
    })
    

    The width and height attributes should give you useful imgWN and imgHN values even when the image data hasn’t loaded. Starting with display:none should avoid an initial shrink from full size to your scaled down starting size; you can also try starting with visibility:hidden and visibility: 'visible' in the .css() call if messing with display doesn’t work.

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

Sidebar

Related Questions

I followed this tutorial http://www.mobiledevelopersolutions.com/home/start/twominutetutorials/tmt4part1 and i have one problem. The geolocation doesn't work
ok i got this problem. i have this routes: (code bit change) File:/home/dotcloud/current/config/routes.js exports.routes
I have a dynamically added list on the home of my jQuery Mobile Page.
the page in question is http://www.streetstyles4all.co.uk/test4.html (general menu drop down problem) Hi I have
I have a problem to set the home page of my application. My rails2
I have a website with only home page available through simple HTTP protocol. All
I have this problem, in a form I have a list of customers that
I have this problem where I open Visual Studio and the internal windows are
i have this problem to find a particular xml node l have post this
I have this problem I've been trying to tackle for a while. I have

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.