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

Floating Items in the browser window

$
0
0

I have a stage that is 4000 some pixils wide.

I have some items tht i would like to be on screen and in a fixed position no mater where you scroll.

 

2 to be centered - content and intro

1 to be top left and  - logo

one to be top right - contact

 

i have the following code that is present in the compisioionReady that floats a symbol named content in the center of the browser window.

 

i need to add the other 3 items to this code.

 

 

Thoughts?

 

 

$(document).scroll(function(){

    var leftEdgeWindow = $(this).scrollLeft()

    setLeftEdge(leftEdgeWindow);

});

 

 

function setLeftEdge(base){

    //get the content symbol

    var contentObject = sym.getSymbol("content");

    //here it is in jQuery

    var content = contentObject.getSymbolElement();

    //get some important widths

    var contentWidth = content.width();

    var windowWidth = $(window).width();

    //find the left edge position

    var leftEdge = base + (windowWidth/2) - (contentWidth/2);

    content.css("left",leftEdge);

    //content.css("position", "fixed");

}

 

 

setLeftEdge(0);


Viewing all articles
Browse latest Browse all 9897

Trending Articles



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