473,441 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,441 software developers and data experts.

iFrame: how to display specific anchor area of external website

Would like to display a specific area of an external website using iFrames.

1) Auto scrolling to target area. Display specific name position.
2) By clicking the name (link). scrolling to target area.

Googling for any solutions did not help me so far.

Any one may help to complete this on how to auto scrolling?

Example: http://www.iwdn.net/showthread.php?t=6376

Modified the code but still not working well.
i.e. Question
On start - Auto scroll to "WEATHER AROUND THE WORLD"
On Click - Scroll to "WEATHER MAPS"
or manually scroll use mouse/keyboard

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3.  
  4.  
  5. <head>
  6.    <title>iframe scroll test</title>
  7.  
  8.  
  9. <style type="text/css">
  10. <!--
  11. #theiframe{
  12.     width:800px;
  13.     height:330px;
  14.     border:0px solid #000; 
  15.     overflow:hidden;
  16.     margin-left:0px;
  17.     margin-top:0px;   
  18. }
  19. #theiframe iframe {
  20.     width:1280px;
  21.     height:1280px;
  22.     margin-left:-253px;
  23.     margin-top:-200px;   
  24.     border:0 solid;
  25. }
  26.  
  27. -->
  28.  
  29.  
  30. </style>
  31.  
  32.  
  33.  
  34. </head>
  35. <body>
  36.    <p>Sample<br>text<br>...<br>...<br>...<br>...<br>...<br>...<br>...<br></p>
  37.  
  38.    <p>Sample<br>text<br>...<br>...<br>...<br>...<br>...<br>...<br>...<br></p>
  39.    <p>Sample<br>text<br>...<br>...<br>...<br>...<br>...<br>...<br>...<br></p>
  40.  
  41.    <p><a href="javascript:void(0)" onclick="iframescroll()">iframescroll(World)</a></p>
  42.    <p><a href="javascript:void(0)" onclick="iframescroll(Map)">iframescroll(Map)</a></p>
  43.  
  44. <div id="container">
  45.    <iframe name="theiframe" id="theiframe" src="http://weather.yahoo.com/?w=2459115" scrolling="yes"></iframe>
  46. </div>
  47.  
  48.    <script>
  49.       function getScrollPos() {
  50.          var r={x: 0, y: 0};
  51.          if(typeof(window.pageYOffset)=='number'){r.y=window.pageYOffset;r.x=window.pageXOffset}
  52.          else if(document.body.scrollLeft || document.body.scrollTop){r.y=document.body.scrollTop;r.x=document.body.scrollLeft}
  53.          else if(document.documentElement&&document.documentElement.scrollLeft!==undefined){r.y=document.documentElement.scrollTop;r.x=document.documentElement.scrollLeft}
  54.          return r;
  55.       }
  56.       function iframescroll(){
  57.          var sp=getScrollPos();
  58.          var i=document.getElementById('theiframe');
  59.          i.contentWindow.location.hash='Weather around the world';
  60.          scrollTo(sp.x,sp.y);
  61.       }
  62.    </script>
  63.    <p>Sample<br>text<br>...<br>...<br>...<br>...<br>...<br>...<br>...<br></p>
  64.  
  65.    <p>Sample<br>text<br>...<br>...<br>...<br>...<br>...<br>...<br>...<br></p>
  66.    <p>Sample<br>text<br>...<br>...<br>...<br>...<br>...<br>...<br>...<br></p>
  67.  
  68. </body>
  69. </html>
  70.  
  71.  
Jun 8 '12 #1
0 2582

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Jeff Napier | last post by:
Is it a security restriction, or is it possible to display an image from a website other than the one on which the applet resides (without external php or javascript workarounds)? Thanks, - Jeff...
2
by: splish | last post by:
Hello, I have the following problem: An Iframe exists inside a page (that has content exceeding the height, therefore scrollbars kick in) - normal stuff. When I want to use anchor references...
5
by: Ric Castagna | last post by:
Greetings, all... I've got a (for me) stumper... I need to attach what will amount to a float:right; sidebar to a specific location on a page. Not an absolute position, mind you, but to a...
2
by: mahesr | last post by:
Frds, how to crawl a specific word in whole website using php.need which page it has Example: want to crawl a 144 items found,on somepage.html. Pls if u have code pls mail email address...
1
by: Raja | last post by:
Hi All, I am very new to .net programming and my project requirement is to continuously monitor for specific content in a website. How do i achieve this task? Can anyone help me in this...
0
by: LudwigWrules | last post by:
I have an iframe on my site. I need the frame to display its "child" page at a specific point. I can do this by setting an anchor, but it makes the parent window go there, too. I was thinking of just...
6
by: deknoopjes | last post by:
I want to display a specific area of an external website using iFrames. A year ago I created such code successfully, but lost this code due to a crashed computer. Googling for any solutions did not...
1
by: preet | last post by:
This page achieves the external website content using inline frames http://www.anchorfx.com/forex/daily-trade-signals/forex-action-bias.asp can the same thing be done in javascript without using...
3
by: yogarajan | last post by:
hi friend I want to display pdf file in my website pls any one guide me it is very urgent Thanks
1
by: perhapscwk | last post by:
is there anyway can use a iframe, and when the page load, the iframe content auto scroll to specific vertical location(such as the center of the whole page) of the page.
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.