how to scale content to fit in iframe

231 views
Skip to first unread message

Manmade

unread,
Apr 13, 2013, 3:17:24 AM4/13/13
to phon...@googlegroups.com

I have a webapp (iphone) with an iframe and I want to resize the content in the iframe so nothing is cropped. I have managed to get this to work with the below code, the problem I get is that none of the links in the page that I load in the iframe works.

And the problem is this:

-webkit-transform: scale(0.30);
-webkit-transform-origin: 0 0;

When I use the transform scaling then for some reason the links stop to work in the page that I load in the iframe. If I remove the above css the links starts to work, but then the content is overflowing and cropped in the iframe.

I use this to scale the content:

<div class="theiframewrap">      
<iframe id="theiframeid" class="theiframeid" src="http://www.mypage.se/"></iframe>
</div>

And the css:

.theiframewrap { 
    width: 320px!important;     
    padding: 0px; 
    top:45px; 
    position:relative; 
    overflow:hidden; 
    border:0px solid #f00;
    z-index:2200;
    }
.theiframeid { 
    height:600px;
    width:100%;
    margin:0px; 
    top:0px; 
        -webkit-transform: scale(0.30);
        -webkit-transform-origin: 0 0;
    z-index:2300;
}

As I wrote, this works, it scales down the content as it should, but why does the links stop working?

Do you have any other way to do it, PLEASE let me know, this drives me nuts :-) Thanks.

Kerri Shotts

unread,
Apr 13, 2013, 9:14:37 AM4/13/13
to phon...@googlegroups.com
Try some larger scale values; I wonder if the touch target is too small with your small scale? Just guessing here, tho. 

Sent from my phone. 

___________________________________
Kerri Shotts
photoKandy Studios, LLC


Social Media:
          Twitter: @photokandy, http://twitter.com/photokandy
          Tumblr: http://photokandy.tumblr.com/
          Github: https://github.com/kerrishotts
                        https://github.com/organizations/photokandyStudios
          CoderWall: https://coderwall.com/kerrishotts

Apps on the Apple Store:

Books:
--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages