|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Floating layer, control in table
I have a flash movie that is placed in a layer which will float with the page as it is scrolled.
In the js it allows the developer to specify the X and Y coords where the layer should display. What I need... I have a table with two rows. The top row contains my navigation, and the bottom cell I want to hold the layer. I want the verticle (Y) to not be positioned to the top of the browser, but to the top of the table cell that it is in. How can I do this? The code is below. Code: <body bgcolor="#ffffff"> <div id="divStayTopLeft" style="position:absolute"> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="200" height="400" id="quotesScroller" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="quotesScroller.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#ffffff" /> <embed src="quotesScroller.swf" quality="high" bgcolor="#ffffff" width="200" height="400" name="quotesScroller" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> </div> <script type="text/javascript"> function JSFX_FloatTopLeft() { var startX = 25, startY = 400; var ns = (navigator.appName.indexOf("Netscape") != -1); var d = document; var px = document.layers ? "" : "px"; function ml(id) { var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id]; if(d.layers)el.style=el; el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;}; el.x = startX; el.y = startY; return el; } window.stayTopLeft=function() { var pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop; ftlObj.y += (pY + startY - ftlObj.y)/8; ftlObj.sP(ftlObj.x, ftlObj.y); setTimeout("stayTopLeft()", 40); } ftlObj = ml("divStayTopLeft"); stayTopLeft(); } JSFX_FloatTopLeft(); </script> </body> |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Floating layer, control in table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|