Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Help needed with setTimeout function

Posted on 2015-01-09
3
Medium Priority
?
209 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 2000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

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.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

609 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