Visokio website     Downloads     Video tutorials     KnowledgeBase  
Content View: Scripting - Get the screen size? - Visokio Forums
Content View: Scripting - Get the screen size?
  •     Bart March 20, 2014 7:41AM
    Hi,

    Is there a way to get a screen size inside Content view with native browser settings enabled? I need to use those numbers to get the right size of my pictures.
  • 2 Comments
  • adrianseijo March 21, 2014 7:53AM
    Hi Bart,

    As discussed, you may do that by using the high level API, which allows you to use traditional browser Javascript and interact with Omniscope, but since the current implementation doesn't allow you to use all the formulas that you can use with preprocessed javascript, it may not be the ideal solution.

    I did some tests and managed to make a working example, that still uses the preprocessed formulas, but relies more on CSS to make the images resize, so I attach it here, and you can just paste it in a Content view and see it working.

    Basically the idea is to have a container, a div in this case, with width and height 100% so it always takes the full view. Then you have a list with the images, and in those images you have an attribute with the value used for the size. The script at the bottom will go through the images, get the max and set the height relative to the max in percentages and that's it. I also put the labels inside the list items and position them so they will be always centered and come after the images.

    Give it a try and tell me if this solves your issue.

    Cheers,

    Adrian
  •     Bart March 21, 2014 9:56AM
    Thank You Adrian, this is what I was looking for

Welcome!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership