Solved

auto close jquery shadowbox

Posted on 2009-07-03
4
1,332 Views
Last Modified: 2013-12-24
I'm using jquery and after 60 seconds I need the shadowbox to automatically close.  I'm using the following sleep function in coldfusion and would like to tie it in.  Any idea?
<cfsetting requesttimeout="60">

<cfset sleep(60000)>
 

..now close shadowbox..

Open in new window

0
Comment
Question by:COwebmaster
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
Opalelement earned 500 total points
ID: 24773848
Shadowbox.close(); is what I see everywhere to close it...

So that means this should work
setTimeout("Shadowbox.close()", 60000);

Open in new window

0
 

Author Comment

by:COwebmaster
ID: 24773934
ok, but where do I place that code?  In the page that opens the shadowbox?  the following doesn't work..
<cfoutput>

<script type="text/javascript" src="[pathtoscripts]/shadowbox/shadowbox.js"></script>

  <script type="text/javascript">

    Shadowbox.init({

        skipSetup: true,

        players: ["iframe"]

    });
 

    window.onload = function(){

    

        // open a welcome message as soon as the window loads

        Shadowbox.open({

            content:    'https:\/\/page.cfm',

            player:     'iframe', 

            title:      "page",

            height:     575,

            width:      900

        });

			    

    };

</script>

  

<script type="text/javascript">

setTimeout("Shadowbox.close()", 60000);

</script>

</cfoutput>

Open in new window

0
 
LVL 5

Expert Comment

by:Opalelement
ID: 24773980
Try setting the 60000 to 2000 and then wait and see if it closes. It should only take two seconds.
0
 

Author Comment

by:COwebmaster
ID: 24774145
ok, that worked.  thx!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
iOS 10 iPad Zoom and acroll 4 54
CSS Scroll Issue 3 91
popup load of page and setting up of session 8 26
JQuery to parse xml string and get element by id 4 23
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

920 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now