Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 05-22-2012, 04:47 PM   #1
Senior Member
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,064
Blog Entries: 1

Rep: Reputation: 90
phonegap / android : when setting the src of an iframe, the main document is replaced


I'm tryng to have some fun with animations in a phonegap application using jquery.

At the moment, I have one div with the main menu of the application, then I have 2 other divs that I will be switching with one another.

Say, it's something like this:

<div id="mainMenu">
<a href="switchPage('page1.html')">Page 1</a>
<a href="switchPage('page2.html')">Page 2</a>
<div id="div1"><iframe id="frame1" src="mainpage.html"></iframe></div>
<div id="div2" style="display:none;"><iframe id="frame2"></iframe></div>
So.... when I click on any of those two links, I check which is the visible div, then I hide this div, I ask the iframe in the other div to have the src pointing to the desired page, then I ask this second div to show up. Everything works fine and dandy.... it it weren't for the fact that the iframe is taking up all of the available space instead of keeping itself in the div's class-defined size. Both are like this:

#div1 {
	width: 100%;
	height: 90%;
	position: absolute;
	background: blue;
I have different background colors to see what room they are taking.

Now, if I don't change the src of the iframe I see the color change in the space of both divs. Nice and dandy.... however, if I set the src of the iframe, instead of the new pointed page taking up the divs room, it takes the whole visible space instead (my menu disappearing).

What's going on?

PS I'm doing a direct iframe.src="blah" and iframe.setAttribute("src", "blah") and it's the same result.


bug, div, iframe, phonegap, src

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] PhoneGap/Android - requestXML is null eantoranz Programming 3 05-02-2012 10:23 AM
PhoneGap/Android - WebUrlLoaderClient timeout eantoranz Programming 0 05-02-2012 10:18 AM
LXer: Setting Up An Android App Build Environment With Eclipse, Android SDK, PhoneGap (Debian Squeez LXer Syndicated Linux News 0 03-07-2011 10:50 PM
LXer: Android App Build Environment With Eclipse, Android SDK, PhoneGap (Fedora 14) LXer Syndicated Linux News 2 02-01-2011 11:11 AM
LXer: Setting Up An Android App Build Environment With Eclipse, Android SDK, PhoneGap (Ubuntu 10.10) LXer Syndicated Linux News 0 01-27-2011 11:30 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:00 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration