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

  • Home
  • SEARCH
  • 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 8814583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:09:47+00:00 2026-06-14T04:09:47+00:00

I run the following code on a page (#home) that should smoothly inject a

  • 0

I run the following code on a page (#home) that should smoothly inject a slider or if the page container is under 480px leave the page as is.

I cannot get the resize event to work 100% smoothly.

If I reduce the window the script (js.slide.js) wont get triggered but the content will be loaded in (slide.php). If I continue to reduce the window a little extra it will all work ok.

Could anyone please advise as to how I could get this working smoothly. The code is as follows

$(document).ready(function(){

if ($("#home").length > 0 ){ 

var homeSlideShow = {
    $promoArea: $('#promo-area'),
    $currentContent: $('#promo-area').contents(),
    $pageContainer: $('.page'),

    init: function(){
        var hSS = homeSlideShow;            
        if (hSS.$pageContainer.width() > 480 ){
            hSS.setTheSlideShow();
        } else{
            hSS.$promoArea.html(hSS.$currentContent);
        }

    },

    setTheSlideShow: function(){
        var hSS = homeSlideShow;                        
        $.getScript(myscript_wp_vars.temp_dir + '/js/slide.js', function(){
        hSS.$promoArea.load(myscript_wp_vars.temp_dir + '/libs/slide.php #c4u-slide',
        function(){
        var options = {
                    preloader: false,
                    nextButton: true,
                    prevButton: true,
                    animateStartingFrameIn: true,
                    transitionThreshold: 250                        
                };

                var sequence = $("#sequence").sequence(options).data("sequence"),
                    $slideShow = $("#c4u-slide");
                });

        });
    }   

};




//
//  Check page size
//
if (homeSlideShow.$pageContainer.width() > 480 ){
    homeSlideShow.setTheSlideShow();
}



//
//  On window resize
//
$(window).resize(function() {   
    homeSlideShow.init();   
});

}// END home.length

});//End $(document).ready(function()

Thanks in advance for any assistance or advice.

Cheers

Noel

  • 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-14T04:09:49+00:00Added an answer on June 14, 2026 at 4:09 am

    window.resize event is triggered multiple times, depending of browser’s behaviour. I’ll suggest you to try this:

    var timeoutResize;
    $(window).resize(function(){ 
            if(typeof timeoutResize != 'undefined') clearTimeout(timeoutResize);
            timeoutResize = setTimeout(function(){homeSlideShow.init();},50);
    
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to run the following jquery code on every page in my website.
I have the following code for a jquery mobile page. When I run it
I have run the following code in this page RsyntaxTextArea using Java and i
If you run the following code, you will see that the URI has a
when I trying to run following code. var result = from c in db.brand
I run the following code from command line: public class MemoryTest { public static
I run the following code on a Windows platform. The purpose is the know
When I run the following Code it crashes at the last line. I don't
When I run the following code I get B as expected: class A {
If I run the following code on my HTC magic phone I get a

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.