Link to an anchor within an iFrame

I need help with this. I know there is some similar topics like this but I couldn’t find the solution for my problem.

I’m using a Nicepage desktop app for web design with one domain and within one of the pages (restoran—jelovnik.html) I have an iFrame which contain the page I have created in Blogger (second domain)(some restaurant menu). iFrame is borderless with no scroll option. Using Blogger html view i have create the anchor:

<div id="vecera"></div>

On my homepage I would like to create the link which should navigate visitor to this specific anchor by scrolling the main page (restoran—jelovnik.html) to it.

How can I do this? 🙁

Thanks.

P.S explanation
enter image description here

I try to navigate to anchor within an iFrame of page by scroling the main page which contain that iFrame. Tried lot of examples but without success.

Maybe this will help.

This is the homepage for ex.:

<html>
<head>
</head>
  <body>
   <a href="https://caravaggiorestoran.blogspot.com/p/caravaggio-restoran-jelovnik.html#vecera" target="restoran_jelovnik">više &gt;&gt;&gt;</a>
  
</body>
</html>

And this is the page which contain the iframe:

<html>
<head>
</head>
  <body>
  
  <iframe src="https://caravaggiorestoran.blogspot.com/p/caravaggio-restoran-jelovnik.html" style="border: 0px none rgb(255, 255, 255); height: 7137px;" name="restoran_jelovnik" onload="javascript:(function(o){o.style.height=o.contentWindow.document.body.scrollHeight+&quot;px&quot;;}(this));" scrolling="no" frameborder="0" marginheight="0px" marginwidth="0px" height="200px" width="100%" allowfullscreen=""></iframe>
  
</body>
</html>

When you click the link on homepage it just open the url which is set as href in new page…but I would like open this content with anchored text on top, inside of my iFrame.

  • Hello Krampus, as I mantioned, the iFrame is fixed (no scroll allowed) withn a parent page of my website and it is pretty long so I would like to navigate (scroll) the parent page to the point where is my anchor inside of Iframe. Thanks.

    – 

  • Well, I’m not sure how to provide this…if I have the working example, I wouldn’t ask for help here. 🙂 Imagine that you have homepage of website and second page (let’s call it “page 2” and the page is scrolable) which contain the iFrame (with no scroling option). IFrame is pretty high and inside of it’s content it hase an anchor for some title for ex. On homepage I have a link and when I click on it I would like to open page 2 scrolled to a title with anchor so it is on the top of the page. So, not to scroll iFrame it self but page 2.

    – 




  • There is some examples which doesn’t work in my case. It opens iFrame content on anchor point but as new page in his original doman…not inside of my iFrame content: <iframe src=”webpage.html” name=”myIframe”></iframe> <a href=”different_webpage.html” target=”myIframe”>Change the Iframe content to different_webpage.html</a>

    – 




Leave a Comment