Quantcast
Channel: Adobe Community : All Content - Edge Animate
Viewing all articles
Browse latest Browse all 9897

Responsive Design - Switch between right/left position

$
0
0

Objective: Trying to dynamically switch an elements position from left to right during window resize.

Example: A "menu" is in 'left':'-100px' position, When window size exceeds 1200px, its position becomes 'right':'distance'

Failed Attempt: It looks like if I have the element's position set to left in properties panel then it only accepts further modifications on 'left' property, similarly if I change it to 'right' in properties panel then it only applies the 'right' inputs.

 

sym.$("menu").css("left","-100px") //in properties panel I have the same settings, left=-100, positioned to left

 

$(window).resize(function() {

                 if($(window).width()>1200){

                                    distance= some calculations here

                                    sym.$("menu").css("right",distance)//Missing something here? like 'position':'right'???

                 }

                 else{sym.$("menu").css("left","-100px")}

});



Viewing all articles
Browse latest Browse all 9897

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>