Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Floating frames 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Does anyone know if it is possible to have i.e. an iframe floating over a frameset within a window?
 
Hey,

I don't quite understand what you
require but have this *experimental*
code. Hope it helps.

(For a better layout, copy all and paste to Notepad)



Code:
<HTML>

<TITLE>Flying Frame</TITLE>

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
<!--
/*
	FlyingFrame.html
	A flying frame.
	JavaScript.
	Steve Puri - stevepuri@[URL unfurl="true"]www.com[/URL]
	Autumn, 27-11-2000
*/

/**************************************************************************************/
/***************************** FlyingFrame configuration ******************************/
/**************************************************************************************/

var flyingFrame = &quot;test.html&quot;;	// path/filename/url to open in flying frame.
var scrollbars = &quot;YES&quot;;		// should the flying frame have scrollbars? (YES | NO)
var startX = 10;		// The initial horizontal position of the flying frame.
var startY = 10;		// The initial vertical position of the flying frame.
var flyingFrameHeight = 200;	// height of opened flying frame.
var flyingFrameWidth = 200;	// width of opened flying frame.
var moveStepsX = 50;		// steps (pixels) to move flying frame to the right.
var moveStepsY = 10;		// steps (pixels) to move flying frame to the bottem.
var speed = 300;		// speed of flying frame (higher is slower).

/**************************************************************************************/
/**************************************************************************************/
/**************************************************************************************/

var moveX = startX;
var moveY = startY;
var screenX = screen.width+50;
var screenY = screen.height+50;
var timer;

function stopFlyingFrame()
{
	clearTimeout(timer);
}

function startFlyingFrame()
{
	FlyingFrame.innerHTML = &quot;<IFRAME SRC='&quot;+flyingFrame+&quot;' MAME='myIFRAME' WIDTH='&quot;+flyingFrameWidth+&quot;' HEIGHT='&quot;+flyingFrameHeight+&quot;' MARGINWIDTH='0' MARGINHEIGHT='0' HSPACE='&quot;+moveX+&quot;' VSPACE='&quot;+moveY+&quot;' FRAMEBORDER='0' SCROLLING='&quot;+scrollbars+&quot;'></IFRAME>&quot;;

	if ((moveX <= screenX) && (moveY <= screenY))
	{
		moveX += moveStepsX;
		moveY += moveStepsY;

		timer = setTimeout(&quot;startFlyingFrame()&quot;, speed);
	}
	else
	{
		clearTimeout(timer);
		FlyingFrame.innerHTML = &quot;&quot;;
		moveX = startX;
		moveY = startY;

		// comment the line below to stop the flying frame from flying forever!
		startFlyingFrame();
	}
}
// -->
</SCRIPT>

<BODY BGCOLOR=&quot;#FFFFFF&quot; SCROLL=&quot;NO&quot; onLoad=&quot;startFlyingFrame()&quot;>

<P ALIGN=&quot;CENTER&quot;>
	A flying frame
	<BR><BR>
	<INPUT TYPE=&quot;BUTTON&quot; VALUE=&quot;Stop&quot; onClick=&quot;stopFlyingFrame()&quot;>
	<INPUT TYPE=&quot;BUTTON&quot; VALUE=&quot;Start&quot; onClick=&quot;startFlyingFrame()&quot;>
</P>

<SPAN ID=&quot;FlyingFrame&quot;></SPAN>

<BODY>
</HTML>
 
To stevepuri: If you can make that IFRAME fly across a frameset, you solved my problem............
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top