473,698 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I make an IFRAME resize itself when someone changes their resolution?

36 New Member
How can I make an IFRAME resize itself when someone changes their resolution?

I have a table in that i am loading that iframe, I did give the width of Iframe and the width of table as 100%, What shall i need to solve the problem...

ANy help would be appreciated..
By @sharf
Jan 9 '08 #1
2 2641
kunal pawar
297 Contributor
give width of Iframe in % then it will work properly
Jan 10 '08 #2
mvmashraf
36 New Member
I did that in percentage but its not working properly,
Any way I got the solution, Its is by using a java script, Just as follows,

Expand|Select|Wrap|Line Numbers
  1. <script>
  2. function getPosition()
  3. {
  4.  var theElement = document.getElementById("ifrept");
  5.  
  6. var widthX = screen.width
  7. var heightY = screen.height
  8. var positionX = 0;
  9. var positionY = 0;
  10.  
  11.  while (theElement != null)
  12.  {
  13.    positionX += theElement.offsetLeft;
  14.    positionY += theElement.offsetTop;
  15.    theElement = theElement.offsetParent;
  16.  }
  17.    var theElement = document.getElementById("ifrept"); 
  18.    theElement.height=(heightY-positionY)-225;
  19.    theElement.width=(widthX-positionX)-98;
  20.  
  21.  
  22. </script>
  23.  
Jan 10 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
9303
by: Catherine Lynn Smith | last post by:
I want to know the recommended way to handle scripting of/with containers such as an iframe. I have a page with border-navigation bars on the top/bottom/left/right and I want to use an iframe to load content in the middle. I would like, if possible, to have the parent window resize itself to suit whatever is loaded into the iframe container, deriving the size needed from calculated values. Thus the calculation would have to over-ride...
1
2383
by: khothikhe | last post by:
Can someone help me here because this is really killing me! the problem is, i have this javascript code in my aspx page that i want it to work on almost all browsers, especially opera and safari : function resize(){ displayFrm = document.getElementById("ifrmDisplay"); innerDoc = (displayFrame.contentDocument) ?displayFrm.contentDocument : displayFrm.contentWindow.document;
9
10890
by: Mark Horrell | last post by:
I'm having problems getting scrollbars to appear using the 'scrolling' attribute of the 'iframe' tag, and I'm wondering if anyone can help me. I would expect the following code to produce a horizontal scrollbar at the bottom of the iframe if my browser resolution is set to less than 950 width, but for some reason it doesn't. Does anyone have any idea why not? <iframe src="http://apps.xxx:8050/" name="iApp" id="iApp"
1
1773
by: Paul Fi | last post by:
I have this problem with iframes: i want to resize iframe's height when the window inside the frame is resized or when the src attribute of iframe changes so make the height of iframe equal to the size window's body scrollHeight so that way i dont need any scrolls for my iframe but the let page containing the iframe do the scrolling for the iframe so how can i make that happen, is one of the iframe events does detect any changes to...
3
4485
by: PCgeek | last post by:
sorry moved this over to javascript forum, didn't mean to post 2x! Hi guys, I'm trying to put the finishing touches on my website and could really use some help on this particular issue. My page includes background music with a javascript music player on the main page below an iframe that is used for all content and navigation of the site and so that the music doesn't reload each time a page is switched. There is another javascript to resize...
1
4141
by: gary.comstock | last post by:
We have a non asp web page that contains a hyperlink which opens an iframe. The iframe is hidden until the hyperlink is selected then javascript toggles the visibility to 'visible'. Inside the iframe is our aspx page which contains a gridview. I've manually set the iframe width to larger than the gridview will ever be and have allowtransparency set to 'true' so you really can't see the iframe, just the gridview. As gridview paging...
1
8130
by: Z1P2 | last post by:
I would like to gradually resize an iframe in an onmouseover event. I can easily do it with an image, but when I try to do it with an iframe, it doesn't do anything. So first of all, is it possible to gradually zoom an iframe, and if so, what am I missing? Here is the script I am trying to manipulate, between the head tags: <script language=JavaScript> /**** adjust these two parameters to control how fast or slow
0
2486
by: msoliver | last post by:
Issue: I want resize handlers within an iframe to be called when the main window changes size. Alternatively, I'd like to know how to propagate a resize event handled by the main window to iframe resize handlers. What's weird is that the iframe resize handles do get called when changing the browser horizontally, but _not_vertically_. I'm talking about IE6/IE7. Sample (simplified) code to explain what I'm talking about: <html> <script...
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7739
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.