Dynamic Window Resizing
Jun 11, 2003How can I resize the window from JavaScript - and it the inner size I need, so window.resizeTo() is no good as that applies to the external size.
I'd prefer the cross-browser, DOM compatible approach if pos.
How can I resize the window from JavaScript - and it the inner size I need, so window.resizeTo() is no good as that applies to the external size.
I'd prefer the cross-browser, DOM compatible approach if pos.
Its my first in this community and I hope someone can help me on this one. I�m currently working on the personalization of the layout of SAP ERP Portal. This Portal Framework uses Iframes to display the current page and/or applications on the Current Page.Here is a custom draw of a page
---- Custom Componentes Like Menus etc
----- Iframe (InnerPage) � Shows the Current Page
--------This Page can have embedded content and/or More Iframes with Applications
All the Iframes are on the same domain but I only have acess to the innerPage Code and not to the iframes that have the applications.Now we want the innerpage to automatic resize to the current content. This is being a problem (even after using jQuery Plugins or Resize Scripts) because:
1)The Iframes that have the applications change content height using Ajax/DHTML (not triggering load event) and this resize scripts wont call the resize mechanism.
2)I don�t have access to the applications source
3)On some tests ive made using Scripts ( for example Auto Height Jquery, SSI Dynamic Drive )some iframes display the same clientHeight and ScrollHeight Even if theres a scrollbar in the browser window.
Does anyone know of how I could dynamically resize an iframe based on
the content's height (for IE) so that no scrollbar appears for the iframe?
The content will be from a different domain. I have searched on the web and
have seen solution like this
<script>
function resize() {
var oframe = document.getElementById("frameID");
//***
//var odoc = oframe.document; //(1)
var odoc = oframe.Document; //(2)
var obody = odoc.body;
oframe.height = obody.scrollHeight;
}
</script>
The html :
<iframe onload="resize()" src=http://different.comain.content border="0"
....... > </iframe>
I have seen 2 solutions on the web, the only difference being lines (1) and
(2) get substitued.
My browser is version IE 6.
It seems that the solution with line (2) works perfectly when the content is
from the same domain but gets a Permission Error if the domain is different.
When the content is from a different domain solution (1) does not give
Permission error, but instead the scrollHeight is significantly smaller
than the actual content. Even if the content is from the same domain it
still gives the wrong size.
So my question is
1) What is the difference between oframe.document and oframe.Document, why
does it give different results?
2) More importantly, how can I dynamically adjust the iframe size based on
the content height from a different domain?
A UI built using HTML and CSS has limited screen space. One of the elements is a div tag (<div id="mtext">) that will contain text of variable length. If the text is > 500 characters, I am displaying it as a link. When the user clicks the link, I want the text to be displayed in a layer above all the rest of the elements in the page. How can this be done using javascript..
Code:
A div element that contains some text of variable length. If the length exceeds say 500 characters, Display it as truncated text. ( like "Example text...") The entire truncated text becomes a link When the user clicks the link the content in the div element "pops out" to fill the screen above other elements on the page Image showing truncated text... (before clicking) Image showing text display after clicking the text...
I want to reload th page after resizing the window (Browser). I used the
event onresize.
The problem the server gets too many requests (on every resize: pixel by
pixel).
window.onresize = myfunction();
What can I do to reload the page only after releasing the mouse.
i have an imagemap, and i don't know where to write in the specific size for the new window popping up...if it's possible? i'm having just an "add to cart" page pop up and i don't need a big space..
<area shape="poly"#$36.95 decorated mixed
coords="590,313,431,309,430,325,565,334,581,315,581,313,581,313,581,313" href="b3695.html" title="$36.95 decorated mixed" target="_blank" />
<area shape="default" nohref="nohref" alt="" />
</map>
I have a quite interesting design from my point of view, but it has a small issue: the maximum screen width can't be wider than 1500px.I would like for somebody to share with me a script which detects the visitors screen resolution and if the screen resolution is higher than 1500px ( for example ) the screen resolution should be re-sized to the maximum point, 1500px in my case.
View 3 Replies View Relatedhow can i resize my html content to displayed size?
all my divs inside are scrollable and resized on loading and on
resizing.
I'm making a drop down box using offset so it's below the correct option, but if I resize the window, the dropdown box keeps the same offset as when the page was originally loaded.
View 3 Replies View RelatedAm making a user registration page and i want it to be smaller then my other pages and it should open in a new window, something like a popup window.
View 2 Replies View RelatedI need help with resizing a popup window in firefox. Currently, I use a JS script to open a popup window, and then resize the window to the size of the image. It works perfectly in IE, but not as well in Firefox.
Funny thing is it does work as expected with some images. The code is identical for every image I use this for, so I cannot figure out why it is not resizing correctly. Code:
I am looking for an option to resize a non fullscreen window into fullscreen mode.
JavaScript provides the well-known method "window.open(fullscreen=yes, ...)" to render fullscreen windows. However, I don't want to open a new window but rather want to resize a window ...in my case ones a user has clicked a button.
I'm having a problem with my dropdown menu every time i see to resize my window the menu side to side moves out of place how can i stop this from happening. Code:
View 1 Replies View RelatedI know how to use javascript to modify a newly opened window's properties. Instead, what I want to happen is someone clicks on a link and they stay in the current browser window, but the window size changes to fit my specifications.
View 4 Replies View RelatedI have a small dillemma I'm trying to solve involving javascript and I was curious if anyone here might be able to tell what the issue is. I'm redesigning my portfolio, and I have a page that involves popup windows, which can be seen at www.souledesign.net/final_site3/portfolio_flash.html. When I click on an icon, it pops up a window successfully. However, the height value I have inputted for the window is ignored, and the window automatically sizes itself vertically to the full height of the web browser.
The code that I've placed on the button that pops up the javascript window looks like this:
href="javascript: void(0)"
onclick="window.open('adbanner1.html', 'realestate', 'width=496', 'height=70')"
This should open a simle XHTML document sized to 496x70px, containing a Flash movie that is displayed using swfobject javascript. unfortunately, the window ends up resizing itself to a height that fills up the entire page rather than properly sizing to 70 pixels.
I have code that works fine in Firefox, but not in netscape.
I would like to open a popup window to display an "email a friend page".
this is my html/javascript
HTML Code:
<a class="emailicon" href="/e/email" title="Email Article" return false;">Email</a>
But my window does not open that size. What am i missint. IE and netscape show a full 100% size browser window.
I wonder why firefox won't work with this script below, but it works on IE, Safari, and Chrome instead?
Code:
$(document).ready(function(){
$(window).resize(function(){
location.reload();
[Code]....
The reason to reload the page is to reload the google map when the window is being resized.
Here is the link to look at, [URL]
I've recently start using Flexigrid (old JQuery grid plugin), and, as you may know, one of the few issue this really good grid plugin got is the lack of liquid layout option. My personal idea to solve the problem is to set the "width" parameter depending on $(window).width. Here is the problem (and here's why i post this question in "General use" and not in "Plugin").
The starting, and working, code is:
$(document).ready(function(){
$("#flex1").flexigrid
(
{
[Code].....
This work fine for me, but I supose it could be done way much elegant... maybe somethin without "IF" that could emulate the "%", like var percentage = $(#div.id).width()*0.XX with the 0.XX picked from an array of percentage, one for each column. Probably I should set up a function... ahhhh, as you may easily see I'm a total beginner with JQuery (and JS in general...)
I'd like to create a pop-up window for my site. I've used behaviors in the past. I'm not sure if that's the best way now. Basiclly I have a photo gallery with thumbnails. Once you click the thumbnail I want a larger window to open with the image. I've seen the javascript windows used that use CSS lightbox, however I can't get it to work with my site. I guess I should mention I'm using asp vbscript ,ms sql database with a link to the image paths that are sitting in the images folder.
View 2 Replies View RelatedI've read through a number of links that discuss various methods of
resizing a div; however, nothing seems to work correctly for me. The
basic idea is that I would like to implement is a panel that can be
hidden (to save space), but collapses smoothly, rather than all at
once.
I've tried setting the div's style.height property. Doing so does, in
fact, resize the div (at least in Firefox 2.0); however, the inner text
does not disappear as the div is resized. Should I apply another CSS
style to the inner text or is there another method of obtaining the
desired results? Code:
<div id="resizetest" style="width:200px;height:200px;border:2px solid blue">
<div style="background:#000033">
<a href="#" style="float:right;background:#ffffff" onclick='document.getElementById("resizetest").height="50";'>_</a>[code]....
Why doesn't this resize? I've looked at examples, and I don't see what's wrong.
how to populate a dropdown based on Another dropdown selection. This all should be a dynamic. Eg: I have two text boxes one is TechID and other is JOB ID. When I start typing Tech ID it suggests me the list of IDs which start with the input string i have put in Tech textbox. When i select the Tech ID the jobs associated to that Tech ID should be displayed in JOB ID text box as a dropdown list.
I am using a popup window to show pictures. Each time the user clicks on
a thumbnail in the mail HTML page, the popup either appears or reloads a
new picture.
Some pictures are portrait, and some are landscape. I build the popup
html dynamically. How can I a) resize the popup window to fit the image,
and b) pop it to the forefront once the new picture is loaded?
i have a div, i set the innerHTML property to a formatted paragraph of
text. however, at times the text exceeds the width (and height) of the
div. how do i create a fixed width div and make it use a scrollbar if
the contents exceed the height and width specified. i'm using microsoft
visual studio, and i have the width explicitly set in the properties
but still on setting the innerHTML it resizes automatically.
I have a frameset page as my index.html page and have noticed that if my
page is opened in other resolution than the one it was created in, some
pictures shift locatiuons.
If this was a non frames page i knew how to fix it...
Is there any was to automaticaly resize a frameset proportionaly to the
screen resolution?
ex: i want one picture to be exactly 1/4 of the screen, in a one-page i
would do someting like...
<img id="logo" border="0" src="Logotipo.jpg">
<script type="text/javascript">
document.getElementById("logo").width=screen.availwidth/4
document.getElementById("logo").height=screen.availheight/4
</script>
How do i do this with a frameset?
ex: banner frame be alway 1/6 of the screen height
We are code crushing the width of images from 285px to 260 pix.
However we aren't changing the height. we need a bit of javascript
that can make that percentage change to the height as well.