From inside a frame scroll parent document to top.

I need a way to click a button inside an iframe to scroll parent the document to top.
LVL 5
mnb93Asked:
Who is Participating?
 
b0lsc0ttConnect With a Mentor IT ManagerCommented:
mnb93,

Does the page have a named anchor?  If so you can try ...

parent.window.location.href="#name";

Let me know if you have any questions or need more information.

b0lsc0tt
0
 
mnb93Author Commented:
no, but how can I make one?
0
 
mnb93Author Commented:
<a name="asdadas"></a>

?
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
mnb93Author Commented:
parent.window.location.href="#name";
 that is like a framebreaker, sorry not what I want.
0
 
mnb93Author Commented:
parent.document.getElementById('name').scrollIntoView(true);
0
 
mnb93Author Commented:
That is the answer
0
 
b0lsc0ttIT ManagerCommented:
mnb93,

If that is the answer then you should not have closed this by accepting my comment, even with a C grade.  I will post to Community Support and ask them to correct this.  They can refund your points and either close it by accepting the answer you posted or delete the question.  Let me know if you have any questions.

bol
0
 
mnb93Author Commented:
But you helped me figure out the answer.
0
 
mnb93Author Commented:
Without your idea, I still wouldn't have the answer.
0
 
b0lsc0ttIT ManagerCommented:
OK, I can respect that.  The C grade made me think I wasn't any help.  I'm glad that I was able to help you and the problem is fixed.  Thanks for the fun question.

bol
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.