Screen size dependency values ​​for data-x in impress.js

Let's say you have the following impress.js

code:

<div id="title" class="step" data-x="0" data-y="0" data-scale="5">
Foo
</div>
<div id="toc" class="step" data-x="10000" data-y="0" data-scale="1">
bar
</div>

      

This displays fine on the screen 1920x1080

because 5

( data-scale

) times 2000

(screen width with some buffer) 10000

.

But:

  • On small screens, it doesn't look pretty (because it's 1920

    big compared to, for example 800

    ); and
  • For large screens, slides may still overlap.

How do I set slide position based on viewport size? So something like 500vw

? (tried this but it didn't work).

+3
javascript css impress.js


source to share


No one has answered this question yet

Check out similar questions:

3953
What value of "href" should be used for JavaScript references, "#" or "javascript: void (0)"?
2701
How do I get the values ​​of a query string in JavaScript?
2466
Sorting an array of objects by the value of the string property
2256
Set default parameter value for JavaScript function
1904
Get the size of the screen, current web page and browser window
1690
How does data binding work in AngularJS?
1630
Make a div to fill the height of the remaining screen.
1618
Copy array by value
1567
Converting form data to JavaScript object with jQuery
1566
Get selected value in dropdown using JavaScript



All Articles
Loading...
X
Show
Funny
Dev
Pics