# Zoom iframe possible?

**URL:** <https://discourse.nodered.org/t/zoom-iframe-possible/44743>\
**Category:** General\
**Created:** [26 April 2021 12:41 UTC](https://discourse.nodered.org/t/zoom-iframe-possible/44743 "2021-04-26T12:41:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![steinerma](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steinerma/32/37666_2.png) [@steinerma](https://discourse.nodered.org/u/steinerma)\
**Post date:** [26 April 2021 12:41 UTC](https://discourse.nodered.org/t/zoom-iframe-possible/44743/1 "2021-04-26T12:41:05Z")

</div>

hi, is there any way to change the zoom level from an iframe window using a variable? So I could change it in the dashboard by a button

```auto
[
    {
        "id": "bd76668e.c11518",
        "type": "function",
        "z": "239682fe.680d0e",
        "name": "",
        "func": "msg.payload = \"https://website.com\" + msg.payload;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "x": 1520,
        "y": 240,
        "wires": [
            [
                "cdf7ea5b.21de78"
            ]
        ]
    },
    {
        "id": "cdf7ea5b.21de78",
        "type": "ui_template",
        "z": "239682fe.680d0e",
        "group": "e664d20c.1424b",
        "name": "Website iframe",
        "order": 1,
        "width": "32",
        "height": "20",
        "format": "<iframe id=\"myFrame\" width=\"100%\" height=\"100%\" src = \"\"></iframe>\n<script>\n(function(scope) {\n // watch msg object from Node-RED\n scope.$watch('msg', function(msg) {\n // new message received\n var x = document.getElementById('myFrame');\n x.setAttribute('src', msg.payload); \n });\n})(scope);\n</script>",
        "storeOutMessages": true,
        "fwdInMessages": true,
        "resendOnRefresh": false,
        "templateScope": "local",
        "x": 1770,
        "y": 240,
        "wires": [
            []
        ]
    },
    {
        "id": "e664d20c.1424b",
        "type": "ui_group",
        "name": "Uebungsprogramm",
        "tab": "f01ad79b.4c5be8",
        "order": 3,
        "disp": false,
        "width": "32",
        "collapse": false
    },
    {
        "id": "f01ad79b.4c5be8",
        "type": "ui_tab",
        "name": "Ereignismonitor",
        "icon": "dashboard",
        "order": 1,
        "disabled": false,
        "hidden": false
    }
]

```

 ![zoom](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/6/d6ac3159503ed50f7d1a40a4dc92577041831946.png)

---

<div class="post-metadata">

**Author:** ![steinerma](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steinerma/32/37666_2.png) [@steinerma](https://discourse.nodered.org/u/steinerma)\
**Post date:** [27 April 2021 12:18 UTC](https://discourse.nodered.org/t/zoom-iframe-possible/44743/2 "2021-04-27T12:18:10Z")

</div>

hi, it is not quite as intended above, however it would also be a possibility to change the zoom factor of the iframe window. I store the value 100% or 75% in the variable "zoom". However, it does not take over the "zoom" value in the "template node" for me. What am I doing wrong?

 ![iframe](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/2/f266ccfb22d4fda766cf5d3b9991473f359f793f.png)

```auto
[{"id":"efbb397b.e9a2f8","type":"ui_template","z":"239682fe.680d0e","group":"e664d20c.1424b","name":"iframe","order":1,"width":"32","height":"20","format":"<iframe id=\"myFrame\" width=\"100%\" height=flow.get(\"zoom\") src =\"'+msg.payload+'\" frameborder=\"0\"></iframe>\n<script>\n(function(scope) {\n // watch msg object from Node-RED\n scope.$watch('msg', function(msg) {\n // new message received\n var x = document.getElementById('myFrame');\n x.setAttribute('src', msg.payload); \n });\n})(scope);\n</script>\n\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","x":1150,"y":640,"wires":[[]]},{"id":"9b84d001.01388","type":"inject","z":"239682fe.680d0e","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":"2","topic":"","payload":"100%","payloadType":"str","x":430,"y":640,"wires":[["967a9757.9a54a8"]]},{"id":"ecc2f03a.6a0fc","type":"debug","z":"239682fe.680d0e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"topic","statusType":"auto","x":870,"y":640,"wires":[]},{"id":"967a9757.9a54a8","type":"function","z":"239682fe.680d0e","name":"","func":"flow.set(\"zoom\", msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":660,"y":640,"wires":[["ecc2f03a.6a0fc"]]},{"id":"777db973.f5a2b8","type":"inject","z":"239682fe.680d0e","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":"2","topic":"","payload":"75%","payloadType":"str","x":430,"y":680,"wires":[["967a9757.9a54a8"]]},{"id":"e664d20c.1424b","type":"ui_group","name":"Uebungsprogramm","tab":"f01ad79b.4c5be8","order":3,"disp":false,"width":"32","collapse":false},{"id":"f01ad79b.4c5be8","type":"ui_tab","name":"Ereignismonitor","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [26 June 2021 12:18 UTC](https://discourse.nodered.org/t/zoom-iframe-possible/44743/3 "2021-06-26T12:18:50Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
