LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 05-22-2012, 05:47 PM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

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


Hi!

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:

Code:
<html>
<body>
<div id="mainMenu">
<a href="switchPage('page1.html')">Page 1</a>
<a href="switchPage('page2.html')">Page 2</a>
</div>
<div id="div1"><iframe id="frame1" src="mainpage.html"></iframe></div>
<div id="div2" style="display:none;"><iframe id="frame2"></iframe></div>
</body>
</html>
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:

Code:
#div1 {
	width: 100%;
	height: 90%;
	position: absolute;
	top:10%;
	left:0%;
	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.
 
  


Reply

Tags
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 11:23 AM
PhoneGap/Android - WebUrlLoaderClient timeout eantoranz Programming 0 05-02-2012 11: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 11:50 PM
LXer: Android App Build Environment With Eclipse, Android SDK, PhoneGap (Fedora 14) LXer Syndicated Linux News 2 02-01-2011 12:11 PM
LXer: Setting Up An Android App Build Environment With Eclipse, Android SDK, PhoneGap (Ubuntu 10.10) LXer Syndicated Linux News 0 01-27-2011 12:30 PM


All times are GMT -5. The time now is 08:57 AM.

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