PDA

View Full Version : iframe content locking?



coat_
09-18-2007, 10:01 AM
hello now I am using this code:


<iframe src="http://url.tld/page.php" name="frame" scrolling="auto" frameborder="no" align="center" height = "100%" width = "100%">


I would like the first 200 dots of iframe content to be skipped (so the iframe content top is 200 dots from the real top). it should not be able to scroll up those 200 dots. is that possible?

Jas
09-19-2007, 12:37 AM
Okay, it should be possible with JavaScript using the scroll() function. i.e. scroll(0,200). Try something like this:



<!-- put this in the body of the page THAT IS IN THE IFRAME //-->
<script type="text/javascript">
window.onscroll = goback;
function goback() {
scroll(0,200);
}
</script>


I haven't really tested it on an IFrame, but I think it will work ?
Hope this helps you out a bit. :)

coat_
09-19-2007, 02:48 AM
thank you however scrolling up should not be possible. the top of the scroll bar has to be the edge of the 200 hidden dots

Jas
09-20-2007, 07:13 PM
thank you however scrolling up should not be possible. the top of the scroll bar has to be the edge of the 200 hidden dots

This should handle that. Anytime the user "scrolls" it should send them back. Are you talking about getting rid of the scroll bar?
Or do you mean that you want them to be able to scroll down and not up?

coat_
09-20-2007, 09:28 PM
the scrol lbar should be at its top at 200 pixels below the ac tual content top

thetestingsite
09-20-2007, 09:34 PM
You won't be able to do that to my knowledge.

//EDIT: sorry for the plain response, but I am short on time here at work right now. I will try to explain better when I get the time; unless someone else wants to handle this one.

coat_
09-22-2007, 08:19 PM
this see ms to work seperately. can you show how to integrate proper ly? the page goes bad now.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1'>
<meta name="description" content="">
<meta name="keywords" content="">
<title>Untitled</title>
<!-- link rel='stylesheet' href='/include/style.css' type='text/css' -->
<style type="text/css">
<!--
body {
padding: 0 520px 0 0;
}
#test {
width: 500px;
height: 700px;
overflow: auto;
position: absolute;
top: -200px;
right: 0;
}
-->
</style>
</head>
<body>
<h1>This is a test.</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur.</p>
<iframe id="test" src="http://www.google.com"></iframe>
</body>
</html>