Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Senior Coder
    Join Date
    May 2006
    Posts
    1,680
    Thanks
    28
    Thanked 4 Times in 4 Posts

    How do I correctly position this ?

    Hi,

    How does the iframe positioning work ?

    I have a cell phone simulation script and when I made
    some changes to the left-hand-side text, the iframe on the
    right hand side went out of align with the holder image.

    This is my script:


    Code:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Nokia Mobile Emulator</title>
    <meta name="keywords" content="Nokia simulator, Nokia emulator, Nokia mobile website">
    <meta name="description" content="See how your website looks in a Nokia">
    <meta name="robots" content="index,follow">
    </head>
    <body>
    <script type="text/javascript">
    /* Old script, still used, but adapted with Cookie creation */	
    var ray={
    changeIframe:function(inp,iframeEl)
    	{
    		this.returnID(iframeEl).setAttribute('src',this.returnID(inp).value);
    		createCookie('QuentinURL',this.returnID(inp).value,30);
    	},
    returnID:function(el)
    	{
    		return document.getElementById(el);
    	}
    } 
    </script>
    <div align="center">
    	<table border="0" width="700" id="table2" cellspacing="0">
    		<tr>
    			<td>
    			<p><b><br>
    			Welcome to our Testing Page.
    			<br><br>
    			On this page you can see how <br>
    			any website looks on a variety<br>
    			of mobile devices.<br>
    			<br><br>
    			The Nokia.
    			<br><br>
    			Enter the website URL below.
    			<br><br>
    			<input type='text' id='userinput' value='http://aspaceplace.mobi6.net/' size="30" name="T1" />
    			<br><br>
    			<button onclick="ray.changeIframe('userinput','myframe');">Test Now!</button>
    			<br><br>
    			<br><br>
    			Now try ...
    			<br><br>
    			<a href="index.htm">Iphone</a>
    			<br><br>
    			<a href="blackberry.htm">Blackberry</a>
    			<br><br>
    			<a href="android.htm">Android</a><br>
    			</font></b>
    			</p>
    			</td>
    			<td width="360" height="639" background="nokia.jpg">
    			<p align="center">
    			<iframe id="myframe" width="275" height="216" src="http://aspaceplace.mobi6.net/">
    			Your browser does not support inline frames or is currently configured not to display inline frames.
    			</iframe>
    			</p>
    			</td>
    			</tr>
    		</table>
    	</div>
    
    <script type="text/javascript" src="geturl.js"></script>
    </body>
    </html>
    My Web Page is this one: The Phone Simulater

    The first page ( The Iphone. ) is OK

    But - When you click on Small Droid or
    the Nokia both are badly mis-aligned.

    How can I correct this ?

    Thanks.



    .
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #2
    New Coder
    Join Date
    Feb 2012
    Location
    England
    Posts
    77
    Thanks
    0
    Thanked 12 Times in 11 Posts
    You can specify the width of the iframe using the height and width artibutes. I always put it inside a div that is excatly the same size, because it allows better positioning.

    If you put the iframe inside a fixed div not a table, then you could use javascript to change the source of the iframe.

  • #3
    Regular Coder Donkey's Avatar
    Join Date
    Sep 2003
    Location
    Blackfield UK
    Posts
    312
    Thanks
    1
    Thanked 36 Times in 36 Posts
    My site on your iphone simulator looked cr@p. On my iphone it looks great. I think you may have a problem.

    BTW It is spelt "simulator"
    " 90% of everything is crud" - Theodore Sturgeon
    Filthy Beast - a 60's Rock Band

  • #4
    Senior Coder
    Join Date
    May 2006
    Posts
    1,680
    Thanks
    28
    Thanked 4 Times in 4 Posts
    Hi,

    Thanks for the reply,

    But the dimensions (width & height ) are not my problem,
    It is the positioning ( top & left or something like that ) that I can not see how to do.

    Are you saying that I need to scrap the table and use divs in order to correct the positioning ?

    Is there no way to adjust position with the code I have ( table ) ?

    Thanks.

    - What is the website url that you checked ??


    .
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #5
    Regular Coder Donkey's Avatar
    Join Date
    Sep 2003
    Location
    Blackfield UK
    Posts
    312
    Thanks
    1
    Thanked 36 Times in 36 Posts
    There is a link to it beneath my sig.

    In your simulator everything overlaps on a real iphone it just becomes smaller in proportion.
    " 90% of everything is crud" - Theodore Sturgeon
    Filthy Beast - a 60's Rock Band


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •