Position jquery ui dialog popup window.

Hello experts.
I have a working code from expert senthurpandian to show a popup window and get the content of another page:http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Jquery/Q_25905726.html

How can i position the popup at the bottom right corner of my page or right top?
<script type="text/javascript">
        $.ui.dialog.defaults.bgiframe = true;
        /*$(function() {
                $("#dialog").dialog();
        });*/
        </script>
<div class="demo">

<div id="dialog" style="visible:hidden;" title="* Article Updates."></div>
</div><!-- End demo-description -->

<script>

        var timerID = null;
        var timerRunning = false;
        var delay = 20 * 1000; // Time interval mins * sec * mili-sec (change mins only)

        function StopTheClock()
        {
			if(timerRunning)
			{
					clearTimeout(timerID);
			}
			timerRunning = false;
        }

        function StartTheTimer()
        {
			timerRunning = true;
			timerID = setTimeout("AjaxTimeOut()", delay);
        }

        function AjaxTimeOut()
        {
                StopTheClock();
                $.ajax({
                        type: 'GET',
                        url: '../user/getlastentries.cfm', 
                        success: function(AjaxHTML){
							//alert(AjaxHTML);
							if(AjaxHTML.indexOf("@123465789@for-telling-page-has-contents@@@") > 0) // Means it has content
							{
								$("#dialog").html(AjaxHTML);
								if(!$("#dialog").dialog("isOpen"))
								{
									$("#dialog").dialog("open");
									$("#dialog").dialog("moveToTop");
								}
							}
                        }
                });

                StartTheTimer();
        }

		$(document).ready(function(){
			// Init
			$("#dialog").dialog()
			if($("#dialog").dialog("isOpen"))
			{
				$("#dialog").dialog("close")
			}
			// Init end
			AjaxTimeOut();
		});

</script>

Open in new window

LVL 2
PanosAsked:
Who is Participating?
 
StealthyDevCommented:
Hi again!

Use the code snipped attached in AjaxTimeOut function:



$("#dialog").dialog("open");
$("#dialog").dialog("moveToTop");
$("#dialog").dialog("option", "position", ['right','bottom']);

Open in new window

0
 
PanosAuthor Commented:
Hi again.
It is working fine.
If you have noticed i did change the ### singns with @@@ in the previous question.Coldfusion use this (#) in his language so i needed to change it.

thank you.
0
 
PanosAuthor Commented:
thank you again

regards panos
0
 
StealthyDevCommented:
Thats great!

All the best :)
Best Regards
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.