473,320 Members | 1,831 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,320 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 2551

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
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.