Rich-text Reply

Elements not responding as expected

jstones 06-07-16

Elements not responding as expected

Hi,

 

I have added a few elements to a page but the elements respond erratically when page is resized.  

 

How do I set the relative position?

 

Thanks

Snip20160607_3.png
Level 2

AllisonR 06-08-16
 

Re: Elements not responding as expected

The responsiveness of the site can be controlled using media queries. Brad outlines an example of how to implement this into your experiment in this Optiverse thread. Using this method, the elements on your site will dynamically rearrange as the screen is resized. More information about media queries is also in this support article.

 

Does this help you achieve what you're looking for? 

 

Best,

Allison
Sr. Technical Support Engineer
Optimizely | EMEA
Optimizely
robertchan 06-08-16
 

Re: Elements not responding as expected

Drag the sides of your browser to determin where you are getting breaks with your console open. From that point, set media queries - this link contains all the different devices you might encounter:

 

Media Queries for Standard Devices

 

In addition, if you're in a rush, you might want to consider just targeting desktop devices for now with your current experiment:

 

/*
 * FROM OPTIMIZELY
 * Usage
 *  Specifies window size (in pixels) to target visitors.
 */

 //target desktop viewports
 //matches CSS media queries for height/width or max/min-height or -width
 window.innerWidth > 1400 && window.innerHeight > 800

 //target mobile phones
 //matches CSS media queries using device-height and device-width
 screen.width >= 320 && screen.width <= 480 && screen.height <= 640
Robert Chan