473,804 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

displaying pre-loaded iframe results in messy output

3 New Member
Hi,

I have a page with two iframes that load content from another website. Only one of the iframes is shown at a time, depending on which tab the user is viewing. If user clicks on tab A, he will see iframe A. Same for tab B.

Users arrive to the page via POST. Sometimes they see iframe A, sometimes they see iframe B, depending on the inputs in the previous page. Both iframes are loaded when arriving to the page, but only one is shown.

When I arrive to the page, regardless of whether I choose in the previous page to see iframe A or B, the content of the iframe is viewed as it should: a list of boxes, with each one describing an item from the third-party database. However, when I click on the tab (and I set display:none for the <span> that contains the iframe that I no longer want to see and display:block for the <span> that contains the iframe that I want to see), the second iframe content is all messed up: all item boxes are shown overlapped one over the other, as if we were using a typewriter with no carriage-return, rendering the list unreadable.

Therefore, it is clearly a problem with the transition from iframe A to iframe B (or viceversa), because each iframe, if shown first, works correctly. Does changing the display property of the <span style="display: none"> <iframe></span> to block have the side effect of messing up the contents of the iframe?

Does anyone have any idea on why would this be happening?

Thanks a lot! I'll appreciate any help, because this is driving me crazy...

Ramon
Aug 12 '09 #1
4 3201
nomad
664 Recognized Expert Contributor
Ramon:

I would use only 1 iframe
take a look at this code
Expand|Select|Wrap|Line Numbers
  1. <body><iframe src="about.swf" name="home" width="500" height="250" align="top" scrolling="auto" frameborder="0"></iframe>
Notice the name="home" the"home" is a target tag and is related to the iframe

For your buttons you need to do this.
button 1
Expand|Select|Wrap|Line Numbers
  1. <a href="about.swf" target="home">about</a>
button 2
Expand|Select|Wrap|Line Numbers
  1. <a href="use.swf" target="home">about</a>
Note the about.swf will be the loaded when the page opens.

hope this helps
nomad
Aug 12 '09 #2
raymon
3 New Member
Thanks for your answer, Nomad.

Your solution certainly works, but my problem is that I'd like the second iframe to load its content while the user is still on the first iframe. In that way, when the user clicks the tab, he doesn't have to wait for the iframe to load, because its content is already there. I was trying to avoid that delay by using two separate iframes... because it is important for the look&feel of my website to have all results preloaded instead of changing the iframe content when the user clicks the tab.

Did you advice me to use only one iframe because it is a known issue that two iframes cannot coexist on the same page and then shown/hidden using display:block/none? No other way to solve this problem than using a single iframe?

Thanks again!

Ramon
Aug 12 '09 #3
nomad
664 Recognized Expert Contributor
Raymand

Make three rows.
add this information to the following

On roll one
Expand|Select|Wrap|Line Numbers
  1. <iframe src="" name="frame1" marginwidth="550" marginheight="550" align="top" scrolling="auto"></iframe>
on roll two
Expand|Select|Wrap|Line Numbers
  1. <iframe src="" name="frame2" marginwidth="550" marginheight="550" align="top" scrolling="auto"></iframe>
On roll three me need to make the butoons.
Expand|Select|Wrap|Line Numbers
  1. <a href="highlights.html" target="frame1">button 1 </a>
Expand|Select|Wrap|Line Numbers
  1. <a href="highlights.html" target="frame2">button 2 </a>
This should work for what you want. once again notice the Iframe name="frame1" and the on for the other iframe name="frame2"
the button have the target as frame 1 and or frame2


let me know if this works

damon
Aug 13 '09 #4
raymon
3 New Member
Hi Damon,

thanks again for your help.

My code looks exactly as you present it in your second solution. The thing is that on arrival to the page, I load the iframes with their content, and then set one of them to display:none and the other one to display:block. When I switch none to block and block to none, the content of the iframe is all messed up. The content is there, but all texts are overlapped one over the other.

Therefore, my specific problem is related to being able to show/hide an iframe without messing up its contents.

Well, I'll assumme that I am trying to do something impossible: setting an iframe to display:none and the expecting that the display:block will show its contents correctly... If someone reads this and has another solution than simply loading the iframe on demand, I'll be so happy to hear about it...
Aug 13 '09 #5

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

Similar topics

7
18540
by: Alan Illeman | last post by:
How do I set several different properties for PRE in a CSS stylesheet, rather than resorting to this: <BODY> <PRE STYLE="font-family:monospace; font-size:0.95em; width:40%; border:red 2px solid; color:red;
2
308
by: Craig HB | last post by:
I am using an asp.net table to display postings in a classifieds website. This is a section of the HTM I am using... <asp:table id="tblAdvert" Width="466px" Height="78px" runat="server" BackColor="Gainsboro" BorderStyle="Solid" BorderWidth="1px" BorderColor="MidnightBlue" GridLines="Both" CellSpacing="0"> <asp:TableRow> <asp:TableCell></asp:TableCell> </asp:TableRow>
12
1359
by: Don | last post by:
With the following, I'm trying to display numberOne and numberTwo, each as a two digit character group, such as "nn". If numberOne or numberTwo is less than 10, "bn" will be displayed (where "b" is a space character). In other words, I always want the second digit of each number to be in the same column, so that the beginning of "restOfText" will start in the same column for each record produced by the following code. I've tried...
4
7324
by: Les Juby | last post by:
Can someone please help with a suggestion as to how I can keep the formatting (carriage returns) that the user enters into a memo field and then display that later. I figured I might be able to use: 'replace carriage returns with BRs comment=Replace(comment, chr(13), "<br>") but obviously net.! The <pre> tag doesn't sem to help either as the embedded return is
2
1264
by: Craig HB | last post by:
I am using an asp.net table to display postings in a classifieds website. This is a section of the HTM I am using... <asp:table id="tblAdvert" Width="466px" Height="78px" runat="server" BackColor="Gainsboro" BorderStyle="Solid" BorderWidth="1px" BorderColor="MidnightBlue" GridLines="Both" CellSpacing="0"> <asp:TableRow> <asp:TableCell></asp:TableCell> </asp:TableRow>
9
5557
by: Eric Lindsay | last post by:
I can't figure how to best display little snippets of shell script using <pre>. I just got around to organising to bulk validate some of my web pages, and one of the problems occurs with Bash shell pieces like this: <pre><code> #!/bin/sh ftp -i -n ftp.server.com&lt; &lt;EOF user username password epsv4 cd /
3
1521
by: raj chahal | last post by:
Hi there I've created a db field with Memo type, and I have stored some text with carriage returns (no html) So the 3 words start on a differnt line. In access this displays correctly ( each word starts on a new line). However when I display these on a web page all the words appear on the same line. I need the words to be displayed on a seperate line.
6
1978
by: Karl Groves | last post by:
I'm trying to work out a mail system which can send an attachment as well as an HTML formatted message (and a default plain text version). I found some pretty good code on PHP.net and modified it a little but I can't seem to get it to work. It attaches the file properly, but only displays the Plain Text message, even in an HTML-capable mail client. I'm guessing it has something to do with the placement of the boundaries,
1
1928
by: ehcy | last post by:
hello guys.. how can i display the <DIR> in my opened files from my text file with table?.. htmlspecialchars is useless.. it always "Warning: file_get_contents() expects parameter 1 to be string, resource given" here's my code for you to see the problem.. <?php $fc = fopen("Check.txt","r"); echo "<table border=\"5\" cellpadding=\"0\" cellspacing=\"2\">\n"; while($handle = fgets($fc,1024)) {
14
3700
ddtpmyra
by: ddtpmyra | last post by:
Hi below is my script displaying all the information inside the table. Pupose: pupose of this php page is to display all the information on my table and have a check box at the last column that will allow the user to approved the member. Problem: I don't how to insert a checkbox on a loop condition. <?php
0
9711
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
10595
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
10343
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...
1
10335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10088
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
6862
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
5529
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...
0
5668
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4306
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

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.