Logic Machine Forum
Javascript ? Iframe ? Parameters how to - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Javascript ? Iframe ? Parameters how to (/showthread.php?tid=2142)



Javascript ? Iframe ? Parameters how to - impactoz - 08.07.2019

In the visualiser I can create a frame, and supply a url, and it will display that lovely page. However I can only supply a URL - I cant pass any other paramaters with it...

I have tried CSS to change and limit what gets displayed in this frame - but of course Id love to get rid of those scroll bars - but you cant do that through CSS (and I have read nearly every post on this board - wow so many knowledgeable people! and Admin is just a master in how quickly he turns around code!)

If I write the following in notepad, save it as a html - its exactly what I want - it displays in the web browser perfectly... And as so many posts mention - this hardware is simply nothing more than a web browser - so I am expecting somehow to do exactly what I have here!

<html>
<div style="overflow: hidden; margin-top: -274px; margin-left:-31;">
<iframe src="http://www.bom.gov.au/products/IDR013.loop.shtml" scrolling="no" height="784"width="538" frameBorder="0">
</iframe>
</div>
</html>


so I have really two questions - and they may be related... As I can only input the url in visualiser and it wont allow other items - how can you supply paramaters like the above ?  Yes I can do height, width in css - but not enough to get rid of those pesky scrollbars

Given the html code above works - how could I write a javascript to display this on a screen (can I do it that way ?) - please explain with detail on what I would need to do as I am still learning (I know how to code - I just mean what / where in using this product.  ie. I have borrowed the wonderful script from this site to return you back to the main menu- and loaded that into my system and it worked first go! So Im technical - just learning this product!)

Look forward to solving this issue somehow - its plagued me for over 6 months - and nobody had the knowledge locally to even help me a little !!! No I have discovered this site - I am amazed of all the knowledge that is out there !!! I am in love with it all... and cant stop reading post after post after post!

Thanks in advance - hoping there is a simple solution!


RE: Javascript ? Iframe ? Parameters how to - admin - 08.07.2019

You can access any HTML properties from custom JavaScript (Scripting > Tools > Edit custom JavaScript).

Code:
$(function() {
  $('iframe').prop('scrolling', 'no');
});

You might have to use additional classes and change the selector if you have have several iframes and you need to disable scrollbars only on one of them.


RE: Javascript ? Iframe ? Parameters how to - impactoz - 08.07.2019

I currently don't have any other iframes - so not worried about setting up classes as yet...

But I must be dumb... I added the code into JavaScript Scripting, saved it.
Went and refreshed the visualisation through a browser - and it still allows the scrolling....

Then I thought maybe that $('iframe') is the class name - so on the iframe object I placed iframe into the additional classes field and tried again - still no change...

As this is the first time I have tried using classes - maybe I need a little more info on what I am doing wrong (but I so excited to know that once I get this working it will open up the world to me!)


RE: Javascript ? Iframe ? Parameters how to - admin - 08.07.2019

You have to enable Persistent mode for this iframe. Keep in mind that custom JS does not work in editor only in user view.


RE: Javascript ? Iframe ? Parameters how to - impactoz - 08.07.2019

I feel like I must be a pain to you - but I am only trying to learn a little (sorry)… But still not working...

Visualisation.png shows the visualisation page - have the URL, have persistent ticked (Good pickup I didn't have that, now I recall reading about that in other posts) - the iframe is saved like that...    

JScript.png shows the javascript from your post above.    

And result.png shows the web page - and the scroll bars - which you are able to use to scroll around...    

I have nothing in CSS anymore - just trying to get the javascript to work first before playing around...

What am I doing wrong...


RE: Javascript ? Iframe ? Parameters how to - admin - 08.07.2019

Your custom JS is incorrect, it's different from my code.


RE: Javascript ? Iframe ? Parameters how to - impactoz - 08.07.2019

I was playing around... trying all sorts of things... experimenting - nothing was working... then I got the message to make it persistent... Which I did - but I stooooopidly did not change the code back to the way you said... argg… I am foolish !

You are spot on - it works beautifully... I LOVE IT !!

Coming from a Clipsal Mk II Touch screen - I have been very disappointed in what I could achieve - BUT NOW my eyes are opening up and can see how much power this has.... All a learning curve

But how can I thank you so much for this.... Please tell your manager another happy visitor here is very impressed with your knowledge, expertise AND patience!