Using iFrame to test your mobile in different screens

Results 1 to 12 of 12
  1. #1
    Good Guy George qet123 is offline
    MemberRank
    Apr 2009 Join Date
    DesertLocation
    1,432Posts

    Using iFrame to test your mobile in different screens

    yeah, took me 15 min to done it.. the point of it to test your web in different W and H.

    index:
    Code:
    <html>
    <head>
    	<title>Test Your Web!</title>
        <script src="JS.js"> </script>
        <style>
    		body
    		{
    			background-color:#366;
    		}
    	</style>
    </head>
    <body>
        <input type="color" name="iFrame_Color" style="position:absolute; top:0px; left:0px; width:155px; height:50px; background-color:inherit">
    	
        <input placeholder="EX: asp.net" type="text" name="iFrame_Src" style="position:absolute; top:50px; left:0px; background-color:inherit">
        <input placeholder="Screen Width" type="text" name="iFrame_W" style="position:absolute; top:80px; left:0px; background-color:inherit">
        <input placeholder="Screen Height" type="text" name="iFrame_H" style="position:absolute; top:110px; left:0px; background-color:inherit">
    	
        <input type="button" value="Post Frame" onClick="JS_PrepareFrame()" style="position:absolute; top:140px; left:0px; width:155px; background-color:transparent;">
        <input type="button" value="Restore Frame" onClick="JS_Restore()" style="position:absolute; top:170px; left:0px; width:155px; background-color:transparent;">
    </body>
    </html>
    JS:
    Code:
    function JS_Restore()
    {
    	location.reload();
    	document.getElementById("iframe").reset();
    }
    function JS_PrepareFrame()
    {
    	var Src = document.getElementsByName('iFrame_Src')[0].value;
    	var Width = document.getElementsByName('iFrame_W')[0].value;
    	var Height = document.getElementsByName('iFrame_H')[0].value;
    	var Color = document.getElementsByName('iFrame_Color')[0].value;
    	
    	iFrame = document.createElement("iframe");
    	iFrame.setAttribute("src", "http://"+Src);
    	iFrame.style.position = "absolute";
    	iFrame.style.top = 0+"px";
    	iFrame.style.left = 300+"px";
    	iFrame.style.width = Width+"px"; 
    	iFrame.style.height = Height+"px"; 
    	iFrame.style.backgroundColor = Color;
    	document.body.appendChild(iFrame);
    }
    Attached Files Attached Files


  2. #2
    • ♠️​ ♦️ ♣️ ​♥️ • שเ๒єtгเ๒є is offline
    MemberRank
    Mar 2012 Join Date
    917Posts

    Re: Using iFrame to test your mobile in different screens

    There are addons for that. At least you code, however.

  3. #3
    Good Guy George qet123 is offline
    MemberRank
    Apr 2009 Join Date
    DesertLocation
    1,432Posts

    Re: Using iFrame to test your mobile in different screens

    Ye, whatever. Another useless thing, these companies destroying the coders.

  4. #4
    • ♠️​ ♦️ ♣️ ​♥️ • שเ๒єtгเ๒є is offline
    MemberRank
    Mar 2012 Join Date
    917Posts

    Re: Using iFrame to test your mobile in different screens

    Quote Originally Posted by qet123 View Post
    Ye, whatever. Another useless thing, these companies destroying the coders.
    Useless? Company? I'm sorry this is very helpful and just one person who coded it.
    I like you still code it for yourself, but it's not really comfort, however.

  5. #5
    Good Guy George qet123 is offline
    MemberRank
    Apr 2009 Join Date
    DesertLocation
    1,432Posts

    Re: Using iFrame to test your mobile in different screens

    Useless thing from me, not from the company

  6. #6
    Coeven Tronic is offline
    MemberRank
    Apr 2010 Join Date
    LocalhostLocation
    238Posts

    Re: Using iFrame to test your mobile in different screens

    did you learn something from it? if u did then it wasnt useless :D

  7. #7
    • ♠️​ ♦️ ♣️ ​♥️ • שเ๒єtгเ๒є is offline
    MemberRank
    Mar 2012 Join Date
    917Posts

    Re: Using iFrame to test your mobile in different screens

    Well in past I coded a lot of things other people made better, too. Just for the personal effort, experience and use. The only difference was, I did not release it, because nobody would need it (except for me, because I like my own stuff).

  8. #8
    Good Guy George qet123 is offline
    MemberRank
    Apr 2009 Join Date
    DesertLocation
    1,432Posts

    Re: Using iFrame to test your mobile in different screens

    Quote Originally Posted by שเ๒єtгเ๒є View Post
    Well in past I coded a lot of things other people made better, too. Just for the personal effort, experience and use. The only difference was, I did not release it, because nobody would need it (except for me, because I like my own stuff).
    I'm like you, and it makes me sad. That's why i'm looking for ideas never been done.

  9. #9
    Developer Eronisch is offline
    MemberRank
    Jul 2009 Join Date
    The NetherlandsLocation
    1,328Posts

    Re: Using iFrame to test your mobile in different screens

    Quote Originally Posted by שเ๒єtгเ๒є View Post
    There are addons for that. At least you code, however.
    I didn't know about that extension, very usefull.

    For other people who would like to try it out, here is the link: https://chrome.google.com/webstore/d...ammmilcgefonfh

  10. #10
    • ♠️​ ♦️ ♣️ ​♥️ • שเ๒єtгเ๒є is offline
    MemberRank
    Mar 2012 Join Date
    917Posts

    Re: Using iFrame to test your mobile in different screens

    Quote Originally Posted by Eronisch View Post
    I didn't know about that extension, very usefull.

    For other people who would like to try it out, here is the link: https://chrome.google.com/webstore/d...ammmilcgefonfh
    Yep that's it. No problem.

  11. #11
    Die() Secured is offline
    MemberRank
    Sep 2011 Join Date
    /home/SDev/Location
    555Posts

    Re: Using iFrame to test your mobile in different screens

    Quote Originally Posted by Eronisch View Post
    I didn't know about that extension, very usefull.

    For other people who would like to try it out, here is the link: https://chrome.google.com/webstore/d...ammmilcgefonfh
    Why would you use a addon when chrome supports this directly from the developer console.
    http://puu.sh/5uSc9.png

  12. #12
    • ♠️​ ♦️ ♣️ ​♥️ • שเ๒єtгเ๒є is offline
    MemberRank
    Mar 2012 Join Date
    917Posts

    Re: Using iFrame to test your mobile in different screens

    Quote Originally Posted by Secured View Post
    Why would you use a addon when chrome supports this directly from the developer console.
    http://puu.sh/5uSc9.png
    Because ...
    • It's two clicks away after pressing F12 and when I keep it open on an extra window I still have to type the numbers manually instead of using resolution bookmarks
    • It's zooming the content instead of sizing the window, I want to see real quality

    But all in all you're right, those devtools are very useful I never doubt, above extension is just a quick solution.



Advertisement