Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently May 21st, 2024, 5:02 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: scaling of Browser object
PostPosted: April 24th, 2017, 6:34 am 
Offline

Joined: October 11th, 2016, 9:48 am
Posts: 5
HTML5 output:
I'm trying to have my Opus Browser object (iFrame) react to my tablet orientation. (resizing of the iFrame)

I can get ScreenWidth and ScreenHight, so in that way I can determine whether I'm viewing in landscape or portrait mode.

The function 'SetObjectDimensions' works beautiful on images, but apparently not on iFrames.

Does anyone know of an easy way around?


var dimInfo = Image1.GetObjectDimensions()
Image2.SetObjectDimensions(dimInfo)


For this message education4life has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: scaling of Browser object
PostPosted: April 24th, 2017, 10:58 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Opus outputs Browser objects to a DIV with an IFRAME child. This is a simple function that will resize both:

Code:
function resizeOpusBrowser(browserName,width,height){
  var tmpBrowser = document.getElementById(browserName + "D")
  var tmpIframe = tmpBrowser.getElementsByTagName("iframe")[0];

  tmpBrowser.style.width = tmpIframe.width = width;
  tmpBrowser.style.height = tmpIframe.height = height;
}


Example for browser object called MyWebPage

Code:
resizeOpusBrowser("MyWebPage","100px","40px")

</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: scaling of Browser object
PostPosted: May 1st, 2017, 4:33 am 
Offline

Joined: October 11th, 2016, 9:48 am
Posts: 5
Thanks so much for that fast reply Mack!

I'm extremly busy so I haven't had time to investigate this any further. My programmer told me that he tried something very similar, but that Opus was overwriting it.

** Can you give me any hint on where to include this in my Opus project, or do I manually add it to my published files??


Thanks very much in advance!


For this message education4life has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: scaling of Browser object
PostPosted: May 1st, 2017, 7:52 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
I wrote it as external JS and called the function from the window object - but the example above is OpusScript safe and can be run from an Opus Script Object function with the call from on trigger using the Opus Script Action.

http://sandbox.interaktiv.co.uk/resize/

</mack>

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group