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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Theory

From novice to tech pro — start learning today.