Solved

Help needed with setTimeout function

Posted on 2015-01-09
3
189 Views
Last Modified: 2015-01-09
My website uses the responsive image slider from slippry.com. On the same page, I want to add a setTimeout function that will delay a modal from appearing. Separately, both work fine, however there seems to be a conflict which I can't identify when both are used.

$(document).ready(function() {
// This is what's used to call the slider:
    jQuery('#slider').slippry({
        adaptiveHeight: false,
        controls: true,
        pause: 8000,
        autoDelay: 5000
        });
       

// This is where I setTimeout:
        setTimeout(function() {
          $('#signUpModal').modal('show');
        }, 2000);

});

Any help figuring out what's going on would be greatly appreciated.
0
Comment
Question by:jej07
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40541186
There will always be a conflict when there is more than one function using a timeout.  You could try a setInterval and see if that helps, otherwise you need to either kill one of the timeout functions; consolidate them; or convert one to use CSS transitions; or change the design to something that works.

Cd&
0
 
LVL 43

Accepted Solution

by:
Rob earned 500 total points
ID: 40541259
Not sure what you're doing wrong as this works ok for me: http://jsbin.com/xuwoce/1/edit?html,js,output

I assume you're using bootstrap for the modal?
0
 
LVL 1

Author Closing Comment

by:jej07
ID: 40541578
Thank you Rob, for setting up a test page. I didn't even know the jsbin.com site existed - it's pretty nice.

Utilizing what you put together I was able to track down the source. Turns out there was another script on the page that I had missed entirely, which was causing the problem.
0

Featured Post

Raise the IQ of Your IT Alerts

From IT major incidents to manufacturing line slowdowns, every business process generates insights that need to reach the people required to take action. You need a platform that integrates with your business tools to create fully enabled DevOps toolchains.

You need xMatters.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question