ShowModalDialog - Window Size

Sep 13, 2006

Its the first time Ive used the showModalDialog function and was wondering how best to size the dialog to compensate for the window borders.

My command looks a bit like this:

500px; dialogWidth: 700px; dialogTop: 150px; dialogLeft: 150px; edge: Raised; center: No; help: No; scroll: No; status: Yes;")'

While I set the width and height to 700 and 500 respectively, the internal size of the window.document object comes out to be 694 and 448.

View 9 Replies


ADVERTISEMENT

Window.showModalDialog For Mozilla

Dec 7, 2003

Somewhat tested on Moz1.5


<html>
<head>
<script language="JavaScript1.2" type="text/javascript">

/*
Notes:
1. edge & help attributes do not work.
2. "height" & "width" must be entered before "center"
3. if you should choose to set "center=yes" do not put in "left" and "top"
4. Minimize button not hidden, but when clicked the window will not disappear
5. Aside from the aforementioned, all features should react the same *fingers crossed*
6. Still in the works, so don't expect miracles. Any problems/queries/complaints please don't hesitate.
Email:
x_goose_x@hotmail.com
*/

dFeatures = 'dialogHeight: 450px; dialogWidth: 1049px; dialogTop: 646px; dialogLeft: 4px; edge: Raised; center: Yes; help: Yes; resizable: Yes; status: Yes;'//default features

modalWin = "";
function xShowModalDialog( sURL, vArguments, sFeatures )
{
if (sURL==null||sURL=='')
{
alert ("Invalid URL input.");
return false;
}
if (vArguments==null||vArguments=='')
{
vArguments=''
}
if (sFeatures==null||sFeatures=='')
{
sFeatures=dFeatures;
}
if (window.navigator.appVersion.indexOf("MSIE")!=-1)
{
window.showModalDialog ( sURL, vArguments, sFeatures );
return false;
}
sFeatures = sFeatures.replace(/ /gi,'');
aFeatures = sFeatures.split(";");
sWinFeat = "directories=0,menubar=0,titlebar=0,toolbar=0,";
for ( x in aFeatures )
{
aTmp = aFeatures[x].split(":");
sKey = aTmp[0].toLowerCase();
sVal = aTmp[1];
switch (sKey)
{
case "dialogheight":
sWinFeat += "height="+sVal+",";
pHeight = sVal;
break;
case "dialogwidth":
sWinFeat += "width="+sVal+",";
pWidth = sVal;
break;
case "dialogtop":
sWinFeat += "screenY="+sVal+",";
break;
case "dialogleft":
sWinFeat += "screenX="+sVal+",";
break;
case "resizable":
sWinFeat += "resizable="+sVal+",";
break;
case "status":
sWinFeat += "status="+sVal+",";
break;
case "center":
if ( sVal.toLowerCase() == "yes" )
{
sWinFeat += "screenY="+((screen.availHeight-pHeight)/2)+",";
sWinFeat += "screenX="+((screen.availWidth-pWidth)/2)+",";
}
break;
}
}
modalWin=window.open(String(sURL),"",sWinFeat);
if (vArguments!=null&&vArguments!='')
{
modalWin.dialogArguments=vArguments;
}
}

function checkFocus()
{
if (window.navigator.appVersion.indexOf("MSIE")==-1)
{
if (modalWin!=null && !modalWin.closed)
{
self.blur();
modalWin.focus();
}
}
}

</script>

</head>
<body onFocus="checkFocus();">
<br>
<br>
<input type="button" onclick="javascript:xShowModalDialog('test.htm',this,'');" value="click">
</body>
</html>

View 3 Replies View Related

Fixed: Window.showModalDialog And Popup Blockers

Aug 15, 2007

I created a little script on a section of a website that password protects the page. It gives a user 3 tries to enter the correct password and then if they get it wrong, it moves them to another page that says they don't have access.

Recently, I upgraded it to do a window.showModalDialog instead of just using a plain javascript prompt as they don't look as nice and clear as a customized JSP could.

However, now that we've sent that upgrade out, we're finding that some of our users are not seeing the window.showModalDialog and it just loads the page (not the no access page).

The script is below. When I look through it, it looks to me that a user with an active popup blocker should just be sent straight to the no_access.jsp file, but that isn't what's happening. Code:

View 2 Replies View Related

Replacement For ShowModalDialog - Disallow Anyone To Browse From A Pop-up Window Without Closing It

Jul 17, 2008

I was trying to find a browser independent way to raise a modal dialog. I know that MS IE has showModalDialog and Firefox has an attribute modal for window.open but I was wondering if anyone knew of a solution out there that would disallow anyone to browse from a pop-up window without closing it. Disabling the text highlighting and right click are not required, just disabling the user from browsing with the dialog open.

View 4 Replies View Related

Font Size Aspect Ratio Change With Window Size

Apr 14, 2011

where da boss wants our a large piece of our site to be fully dynamic and integrated on any screen size. This means changing font on size. Well I cam up with a solution, figured if no one has one better, then i'll share

[Code]..

View 7 Replies View Related

JQuery :: Adjust Content Size According To Size Of Window?

Aug 26, 2011

I am new to Jquery mobile framework.I have an asp.net web application and I want to convert it into Jquery mobile framework.I have a datalist on an aspx page.The size of the datalist decreases according to the window size to certain extent after which the size of the datalist becomes constant and doesn't decrease with the window size.

View 2 Replies View Related

Possible To Re-size Image To Fit Window Size?

Aug 31, 2011

I started learning javascript couple of days ago, so this may be a noobie question.

I wrote a simple code that should re-size the image (there's some other code in here just in case) code...

View 1 Replies View Related

Re-size Image To Fit Window Size?

Aug 31, 2011

I started learning javascript couple of days ago, so this may be a noobie question.

I wrote a simple code that should re-size the image (there's some other code in here just in case) code...

View 4 Replies View Related

How To Get Window Size (not Viewport Size)

Apr 6, 2010

I'd have thought this would be easy but I've been looking for hours and all I can find is info on getting the viewport size, which is normally useful but not in my situation.

In this case I need the actual browser size, including the scrollbars, toolbars, status bars etc. to get an idea of browsers which aren't maximised/full screen and how big they are, and to calculate the amount of the screen taken up by toolbars etc too.

View 3 Replies View Related

Script To Close Old Window And Open New Window With New Link And Specific Size

Jan 29, 2006

I need a script that will open a new window (popup / new link) in a specific size, but will also close the old window (where the popup came from). I know the popup window is easy but finding a work-able close window script as the new window is opened is impossible!!

View 3 Replies View Related

Need To Customize The Size Of The Window.open Window For Different Links

Jul 23, 2005

I've got this row of images (in the end there will be more rows of pics
as well). When a user clicks on the image, I want a new window to open
with a larger version of the image. I want that new window to be
customized to the size of the new larger image. Also, when users go
back to see other images in their larger size, I want the new window
(assuming they never closed the first one) to come back to the front.

I've only gotten as far as getting the larger images to open in a new
window at a set size in the function. I thought I could just make
specific scripts for each image, but that would be cumbersome to say
the least....

View 1 Replies View Related

Refresh ShowModalDialog

Jul 23, 2005

i am trying to refresh a ShowModalDialog that contains information. I have
search about it but it never seems to be possible. As anybody got some
info., way, idea, documentation about a ShowModalDialog refresh.

View 2 Replies View Related

ShowModalDialog(...) Problem

Sep 2, 2005

window.showModalDialog('myPage.xml','','help:No;status:No;resizable:Yes');

This code for some reason does not work.
If instead of myPage.xml I give it a URL or HTML page it works fine but not with xml page. Why?

View 6 Replies View Related

Sleep() Function - ShowModalDialog In Firefox?

Jan 4, 2006

From some examples, I created a sleep() function which can put a javascript into sleep while it is executing. It is using the IE-only function showModalDialog. Does anybody know a function which does the same in Firefox and other browsers, or a function which also stops the execution of a script temporary?

This is what I got so far:

View 2 Replies View Related

Window Size Without Toolbars And Etc...

Feb 1, 2006

is there a way to get the available size inside the window?
technically a kind of otherHeight - (toolbarsH + scrollbarsH + etc).

View 2 Replies View Related

Pop Up Window Size And Border

Jan 19, 2006

I am using Dreamweaver to open a pop up window when you click in a thundnail to make the picture bigger. In Dreamweaver you have the option to specify the dimensions of the pop up window(in my case the same as the photograph). It seems to work fine in Explorer, but Safari leaves a white border along the right and bottom edges(aprox 14 pix). I have tried to do the window smaller but then in other browsers you need scroll bars. I would like the new window be exactly the same size of the photograph. Is there any easy way to control this?

View 3 Replies View Related

Fixed Size Pop-up Window?

Apr 1, 2009

I have a "Roaming Companion" on my sites index page (www.studylinks.org - look for the red R) and I would like to fix its size and disable the expand and maximize functions. I assume it's in the Java rather than the HTML or CSS but do tell me if i'm wrong.I'm new to the forum so please forgive any posting/etiquette errors on my part. Javascript Document

function doPopups() {
if (!document.getElementsByTagName) return false;
var links=document.getElementsByTagName("a");

[code]....

View 2 Replies View Related

Changing Window Size

Oct 5, 2003

I have a photo gallery which lists out a bunch of photos. You can click on one which will open the photo in another window for you to view. In this window then, you are able to go to the next image, to the previous one, etc.

Now, I have some images which are portrait style, some are landscape. I want to have the window that the images show in to be adjusted on the fly depending on the orientation of the photo. I.e., if the photo is landscape, I want to display it in a window which is 800x600 in size; if it's portrait, I want to display it in a window which is 600x800.

All the thumbnails have the following code for their href: Code:

View 1 Replies View Related

Popup Window Each Has Own Size?

Feb 11, 2009

i am having a problem with javascript. I have a page with a bunch of links on it, and whenever someone clicks on link i want it to popup, but each popup to have its own size, instead of a fixed size.lp.

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function Help(URL) {
day = new Date();

[Code]....

View 3 Replies View Related

Call A Method In Parent Object From A ShowModalDialog?

Oct 13, 2011

I have defined a method in an iframe named as refresh1().In the iframe we are showing records in a table.on clicking a record of table or you can say row a showmodal Dialog object will open which shows the info of clicked record.I want to call refresh1() method onclick of save button whic is defined in modal dialog.I have triedparent.window.dialogArguments.refresh1() but it is not workin.

View 2 Replies View Related

Window Resize To Required Size

Jul 23, 2005

A dynamically created html page contains a body tag with a single (filled)
table in it. Sie size of the table changes in a wide scale (from 5% to 150%
of the screen size independent in height and width.
The page is displayed in a popup window opened either via an onclick-event
or a href anchor (depends on the navigation). Now the obvious problem is
this:
When choosing a fixed window size things look silly most of the time. Either
you have a nearly empty window or you have to scroll all the time...

So I want to resize the window. Resize it to what size? The size that is
required by the pages content when redered in the browser. That's all :-)

-- hmmm -- I tried around quite a lot with scrollHeigths, offsetWidth and so
on, but there does not seem to be any more or less reliable solution.,
Especially not when trying to make stuff usable for different browsers.
Does anyone have a hint what else I can try, where I could look?

View 2 Replies View Related

Adjusting A Picture To The Size Of A Window

Jul 20, 2005

I'm a newbie...I'm having trouble changing the size of an image when I
use different window sizes when loading the and resizing the browser window.

View 3 Replies View Related

Popup Window Size / Style

Apr 10, 2009

I need to know where and how to put the script that when the window opens I can set the size, scrollbar, etc.

View 4 Replies View Related

Open A New Window Half The Size!

Apr 29, 2007

How do I do if I want to open a new window half the size of this when I click on a link?

View 1 Replies View Related

Open New Window + Image.size

Apr 19, 2006

I want every time i click on a link a new window to appear.. The new window i want to have the dimensions of the included picture. Finally I want a close button on the window ..

View 5 Replies View Related

Login In Same Or Other Window With Controlled Size

Sep 5, 2011

Code:
<?xml version="1.0" encoding="[CONTENT_ENCODING/]"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="[LANG_CODE/]" lang="[LANG_CODE/]" dir="[BASE_DIRECTION/]">

[Code]....

for creating pop-up but problem is that pop-up not displays user's home page instead it displays login page again(which is not required). how to create a pop-up which displays user's home page??

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved