[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


How do I animate a div on the parent of my iframe using Jquery?

Posted on 2011-05-09
Medium Priority
Last Modified: 2012-05-11
I have a main page and on it I have an iframe and a div.
Inside the iframe I have an external html page with a button on it.
Using this button inside the iframe how do I animate the div on my parent page?

I have tried something like this:
            $("top").contents().find("#iFrameID").animate({"top": "-450px"},{ queue:false, duration:800, easing:"quartEaseInOut"});

This does not work. Could anyone show me how to fix this code?
I am attaching the Jquery files I am using.

Question by:badwolfff
  • 3
LVL 14

Expert Comment

ID: 35718627

Author Comment

ID: 35718899
thanks for the idea robasta
doesn't work

Accepted Solution

badwolfff earned 0 total points
ID: 35758920
I found a workaround myself:

create a function

function move(){
     $("#iFrameID").animate({"top": "-450px"},{ queue:false, duration:800, easing:"quartEaseInOut"});

and I run it using top.move

However it is strange that no one at this forum or on the jquery forum knew how to sort this simple problem considering that we all use iframes and this kind of problem should be pretty common.

thanks all anyway for trying

Author Closing Comment

ID: 35783918
I worked it out myself

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to implement server side field validation and display customized error messages to the client.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question