 |
 |

03-18-2006, 02:06 PM
|
 |
Centurion
|
|
Join Date: Dec 2005
Location: Istanbul
Posts: 108
|
|
iframe
|
I have html page from another site I need to use it in an Iframe, is there a way to position the page so only a part of the page is visible.?
The iframe is only 50x400 with one line of text from the other page visible.
<iframe width="200" height="50" src="http://www.yahoo.com ></iframe>
|
|

03-18-2006, 02:13 PM
|
 |
Web Junkie
Retired Moderator * Expert *
|
|
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
|
|
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
|

03-19-2006, 04:52 AM
|
 |
Centurion
|
|
Join Date: Dec 2005
Location: Istanbul
Posts: 108
|
|
iframe -link..still there is a problem
PHP Code:
<html>
<head>
<script type="text/javascript">
function scrollWindow()
{
window.scrollTo(500,100);
}
</script>
</head>
<body onload="scrollWindow()">
</body>
</html>
|
Last edited by gencoglu27; 03-19-2006 at 06:48 AM.
|

03-19-2006, 04:55 AM
|
 |
Centurion
|
|
Join Date: Dec 2005
Location: Istanbul
Posts: 108
|
|
Hi,
Not sure how to link the webpage I want to use inside iframe tag
can you help me please ?
for example ,I want to use "http://www.yahoo.com" and I want to make the "yahoo logo" visible only
Quote:
|
Originally Posted by gencoglu27
PHP Code:
<html>
<head>
<script type="text/javascript">
function scrollWindow()
{
window.scrollTo(500,100);
}
</script>
</head>
<body onload="scrollWindow()">
</body>
</html>
|
|
|

03-19-2006, 06:01 AM
|
 |
Centurion
|
|
Join Date: Dec 2005
Location: Istanbul
Posts: 108
|
|
Okay, I did some google and got the following solution..thanks
PHP Code:
<iframe name="MyIframe" src="img2.html" width="300" height="40" frameborder="0"scrolling="yes"marginwidth="0"marginheight="0">
</iframe>
<script type="text/javascript" language="JavaScript">
function scrold() {
var PixelsFromTop = 190;
var PixelsFromLeft = 22;
window.MyIframe.scrollTo(PixelsFromLeft,PixelsFromTop);
}
setTimeout('scrold()',2000);
//-->
</script>
|
|

03-19-2006, 06:46 AM
|
 |
Centurion
|
|
Join Date: Dec 2005
Location: Istanbul
Posts: 108
|
|
|
still there is a problem ..
var PixelsFromTop = 190;
var PixelsFromLeft = 22;
in spite of the values above ,it displays top:0 and left:0 ?
There is no effect even if I change the values above..
Whats wrong with this code?
|
|

03-19-2006, 08:42 AM
|
 |
Junior Contributor
|
|
Join Date: Aug 2003
Location: Denver Co
Posts: 249
|
|
This works:
HTML Code:
<html>
<head>
<script type="text/javascript" language="JavaScript">
function scrold() {
var PixelsFromTop = 20;
var PixelsFromLeft = 50;
window.MyIframe.scrollTo(PixelsFromLeft,PixelsFromTop);
}
window.onload = scrold;
//-->
</script>
</head>
<body onload="scrold()">
<iframe name="MyIframe" src="demo.html" width="100" height="100" frameborder="0"
scrolling="yes" marginwidth="0" marginheight="0">
</iframe>
</body>
</html>
...but, it will only work if the src page is from the same domain....not too sure why though....
|
|

03-19-2006, 08:54 AM
|
 |
Centurion
|
|
Join Date: Dec 2005
Location: Istanbul
Posts: 108
|
|
|
does it work for remote web sites? I mean what about ? "http://www.yahoo.com"
I tried but failed...
|
|

03-19-2006, 09:00 AM
|
 |
Junior Contributor
|
|
Join Date: Aug 2003
Location: Denver Co
Posts: 249
|
|
|
Not sure why it doesn't work for remote sites (sites not on your domain) but do consider the fact that this is potentially "BandWidth Theft/Hot linking"....
|
|

03-19-2006, 09:28 PM
|
 |
Web Junkie
Retired Moderator * Expert *
|
|
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
|
|
|
1. Don't start multiple threads for the same question. It's easier on the people helping you if all the information is together.
2. It's not working on other sites for security reasons. It's called Cross-Site Scripting. I know you just want to scroll but... if you can manipulate the other page, someone could interject script on a page, that submits to a different site with out the user ever knowing. it's a HUGE security risk. That's why browsers don't allow it.
|
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
|

03-20-2006, 03:39 AM
|
 |
Centurion
|
|
Join Date: Dec 2005
Location: Istanbul
Posts: 108
|
|
|
Oh yes,
I should have known that...
yet I managed the use iframe having another web page inside it,
I used a <div> with some CSS ,and hide some unwanted part...and easily located it
in the web site...it took me 1 hour..
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|