Languages

Menu
Sites
Language
Zoom content in an iframe

Hi,

I want to be able to start with a zoom of 150% or 200% for the content of an iframe, any ideas how this can be achieved:

css:

#my-div
{
    width    : 360px;
    height   : 360px;
    overflow : visible;
    position : relative; 
}

#my-iframe
{
    position : absolute;
    top      : -260px;
    left     : -25px;
    width    : 540px;
    height   : 840px;
}

html:

<body>
<div class="ui-page">
  <div class=contents>
<div id="my-div">
<iframe src="http://www.bom.gov.au/products/IDR664.loop.shtml" id="my-iframe" scrolling="no"></iframe>
</div>
  </div>
  </div>
</body>

 

Responses

6 Replies
André Reus

hi~

I made it scrollable and give a predefined height, width. It works for me like this, 

index.html

<div class="" id="main">
    <div class=>
		<iframe src="http://www.bom.gov.au/products/IDR664.loop.shtml" id="my-iframe" scrolling="yes" height="360" width="360" ></iframe>
	</div>
</div>

Css

#iframe {
    zoom: 0.75;
}

 

Output:

Smith

Hi,

Sorry it has taken a while to get back to you thanks.

Unfortunately on the Gear S3 there is no zoom, only pan around, I want the animated map part of the page ONLY to load into an iframe or directly on the page NOT the whole page.

Is it possible to get the above to work?

What about another approach to load the whole page and pick out the DIV that is for the animated map only and load this DIV in a DIV on the page?

It would be appreciated if you could help get this to work.

Cheers

 

Smith

Hi,

The following is the best I have so far but it does not zoom properly:

#iframe {
    zoom: 3;
}

 

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="Tizen Wearable basic template generated by Samsung Wearable Web IDE"/>

    <title>Tizen Wearable Web IDE - Tizen Wearable - Tizen Wearable basic Application</title>
    <link rel="stylesheet" type="text/css" href="css/style.css"/>
 <script src="js/main.js"></script>

</head>

<body>
<div class="ui-page">
  <div class=contents>

<div class="" id="main">
    <div class=>
        <iframe src="http://www.bom.gov.au/products/IDR663.loop.shtml" scrolling="no" style="height: 790px; border: 0px none; width: 535px; margin-top: -275px; margin-left: -32px; "></iframe>
    </div>
</div>
</body>
</html>

Can you get it to zoom properly?

Smith

Hi,

Okay I think I have found the problem the initial-scale=1.0 and maximum-scale=1.0 seem to limit, I have set to 1.3 and 2.5 which works:

However I need to start with Brisbane positioned in the centre of the screen when app starts, do you know how to do this?

Loads like this which is positioned top left:

I want it to be like this below with Brisbane in the centre but still pan around to top left:

 

 

André Reus

Yes i think you can do it by scaling and using CSS. 

Smith

Hi

I have the scaling working as above but what is the css code to position the content? Not the iframe position but the position of the content?