Intresting Window Resizeing Problem Using InnerWidth, OuterWidth
Jun 25, 2003
The problem is that i want to open a new window with the corect size in wich should fit a aaaXbbb px size picture!
The following isn't right:
window.open("","height=bbb width=aaa" )
Because only the window will have the specified size and the picture will not fit inside!
An other option wich works under Netscape, Opera is the following:
if (window.innerWidth || window.innerHeight)
{
docwidth = window.innerWidth;
docheight = window.innerHeight;
var dw,dh;
dw = window.outerWidth;
dh = window.outerHeight;
}
window.resizeTo(bbb+dw-docwidth,aaa+dh-docheight);
This works fine under Netscape, Opera but IE doesn't know both innerWidth, outerHeight!
View 3 Replies
ADVERTISEMENT
Jul 8, 2005
I have the following script resizeing my iframe based on height. The problem is if my site is on one domain say http://mydomain.company.com and the target page is on another domain say http://anotherdomain.mycompany.com the script does not resize the page. I cannot add anything to the pages i am linking to because they live in a CVS repository so i cannot call a function or passs information in that way.
is there any way to make my script work? I'm so fustrated, I'm so close! help!
<!--this script auto resizes the height of the iframe based on contents-->
<script type="text/javascript">
<!--
function resize_iframe(){
document.getElementById("_iframe").height=768 // required for mozilla/firefox bugs, value can be "", null, or integer
document.getElementById('_iframe').height=window.frames["_iframe"].document.body.scrollHeight
}
// -->
</script>
which uses the following iframe
<iframe width=96% id="_iframe" name="_iframe" src="intro.htm" scrolling="no" frameborder="no" ALLOWTRANSPARENCY="true" onload=resize_iframe();></iframe>
View 3 Replies
View Related
Jan 12, 2010
I've been using the page [URL] as my guide to innerWidth/innerHeight, to resize an open browser window when the content switches from form A to form B. innerWidth/innerHeight appears to work in all non-IE browsers, but of this subset, non-Mozilla browsers seem to keep these properties read-only. And yes, I know Firefox, Opera, and others can disable Javascript resize of windows, but I would like to make this work as often as possible.
View 2 Replies
View Related
Jul 17, 2011
I decided to write a script that resizes the content of the flash site, but the problem is that it does not work. I put the code on body section.
[Code]...
View 1 Replies
View Related
Aug 26, 2009
Does anyone knows a method to measure the scrollbar's width, which works in Safari/Chrome.
The innerWidth function doesn't seem to take the scrollbar's width into account when measuring the innerWidth of the child element of a scrollbared element.
View 4 Replies
View Related
Apr 26, 2011
I have a website which displays photos. I want the photos to be resized depending on the innerWidth and innerHeight of the browser. I have my resolution set to 1024x768. So if you go to [URL] and click on 'Commissions' my 'w' variable in the URL contains 1024 but for some reason the 'h' variable displays 50. If I click on 'Commissions' one more time then it correctly displays h=602.
View 9 Replies
View Related
Jan 29, 2010
I have a HTML and I am opening another link in a separate window using window.open() . The child window is something like 'http://yahoo.com' which is out side html. I need to refresh the parent window when the child window is closed.
View 4 Replies
View Related
May 11, 2011
My WEB site opens an application window and then, from its original window it navigates to a status page.
Code:
var newWindow
function popUpApplication() {
[code]...
View 5 Replies
View Related
Mar 24, 2011
i have this code i need to close the parent.html window when the child window opened, i need the code for that working well in IE and Firefox Parent.html
<HTML>
<SCRIPT TYPE="text/javascript">
function sendTo()
{
window.open('child.html','_blank','resizable=yes,width='+(screen.width-500)+',height='+(screen.height-500)+'');
}
[Code]...
View 2 Replies
View Related
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
Jan 8, 2004
I have a popup window which has the search form in. What I want to do is for the popup window to close once the form is submitted, and to post the form data to a page on the main window.
Is anyone able to advise. As the main page is dynamic, it is not possible to give the page a name.
View 4 Replies
View Related
Aug 11, 2011
I am trying to usw window.open , upload a file in the child window and then referesh the parent window. But once upload is done, window . opener .location.href or opener.location.replace sends a message back but I get a pop up blocker, so if I turn pop up blocker off, it opens in new page. I just want the parent page to refresh on the same window. This works on some employees stations but not on others..I don't know if there are any settings on IE that need to change, I tried everything...weird. does any one done this before?
View 1 Replies
View Related
Nov 22, 2011
I am trying to pop up a window and then do stuff(set flags) when the content of the new window is done loading. For this I am trying to detect the window.onload of the pop-up child window but so far I am unsuccessful. I believe my problem is that the URL of child window is on different domain, than the one of the opener(parent) so that the window.onload is not being called. Though this may change, at the moment I do not have access to the code for the page I'm opening up in the pop-up. Im pretty new to web development.
[Code]....
View 3 Replies
View Related
Apr 23, 2011
I want to preserve a 16/9 aspect ratio to the window after any resize, making the width a function of the height.
As I have a window.resizeTo() inside the window.onresize event function, the infinite loop is served. How may I quit it?
<html><head><title>Title</title><script languaje="javascript">
const c_ra=16/9;
window.onresize = function WindowReSize() {
var myWidth = 0, myHeight = 0;
[Code].....
View 2 Replies
View Related
Jun 13, 2011
Im trying to create a hidden form field in a parent window from within a child window (popup). I am trying to use jQuery, but unfortunately the hidden field does not get created.
Code JavaScript:
View 2 Replies
View Related
Dec 24, 2005
I am trying to open up a new window and then get the current url/location
back from the (win_1) window and display the url in an alert box.
Here is the code I am using :-
<script type="text/javascript">
var mywin_1 = open ("http://www.anysite.com/index.htm", "win_1",
"height=640, width=820, left=200, top=0, scrollbars, status, location");
var temp = mywin_1.location;
alert (temp);
</script>
Where am I going wrong?
View 2 Replies
View Related
Jul 20, 2005
I have a couple of utility windows - a calculator and a calendar that popup
from my main window. I would like them to always stay in front of the parent
window until they are shut down with there own close buttons. As it is, when
you click back to the parent window, of course it comes in front of the
child windows. Can I do this?
View 4 Replies
View Related
Apr 25, 2011
code to show ( overlay / modal window ) to the user when closing or navigating away from the page ( i want put in this window facebook share to make the user to share the page in his facebook ) , bytheway i wanna use it in my wordpress in every post could it be happen ?
View 1 Replies
View Related
Apr 7, 2007
My problem is that ..... I have to select Data from Popup Window and get that Data back to my Parent window's textarea field..
View 2 Replies
View Related
Sep 23, 2010
I need to open a popup window from a PHP site and pass in some parameters to use in the pop up window. I have the params in an input box and need to get the val of the box into a param and pass it to the new popup window. All pages are local and in the same folder. The id of the input box is 'ddutykey'. The name of the new window would be showduty.php if possible.
View 3 Replies
View Related
Feb 1, 2010
I have an HTML page where I am opening a child window using window.open. the child window is something like yahoo.com. I want to refresh the parent window when the child window is closed.
View 1 Replies
View Related
Nov 13, 2011
I'm using window.showModalDialog but having an issue trying to set the parent window(main browser). I open modal window A which is then opens modal window B, top of modal window B onload I do window.opener.close()". My issue now is when i'm finished with B I set parent window(main browser) to a new url with window.opener.location. So my problem is modal window A the parent has been closed so window.opener.location will not work.
View 3 Replies
View Related
Jun 25, 2009
Put a link on my page that will open an external site (over which I have no control) in a pop-up window. When the user closes the pop-up, I want my original page to redirect to another page. The difficulty I'm having is that I can't add any code to the page in the pop-up as it's not my site.
View 4 Replies
View Related
Jul 23, 2005
I'm having some difficulty in renaming a window object. I'm opening the window in question via a targetted submit:
<!-- CODE EXCERPT FROM WINDOW 1 -->
<form target="newWin">
Based on certain criteria, I sometimes need to close window 1 and have
window 2 take its name:
<!-- CODE EXCERPT FROM WINDOW 2 (currently named "newWin" -->
var strWindowName = opener.name;
opener.name = null;
opener.close();
//Ensure the window doesn't hold onto the instance
opener = null;
//Rename the window
window.name = strWindowName;
top.name = strWindowName;
While an alert at the end of my function indicates that the renaming
has been successful, when I submit the form on window 2 I find that
the window name has reverted to "newWin". For some reason however,
refreshing the window makes the correct (previous opener) name stick.
View 1 Replies
View Related
Jul 23, 2005
Is that possible I can assign an window object variable to an already opened
window? With window.open(), we can get a window object from opened window.
If a window has already opened, is there any way I can attach that window
with an object variable in javascript? Because I want to communicate with
that window.
View 3 Replies
View Related
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