0

im having a website that loads a website into an iframe

 <iframe src="<?php echo $url ?>" id="exframe"></iframe>

what i want to do is in this website there are loads of images on top so once the iframe is loaded i want to slide to the bottom content

within the iframe, the website has the below classes and ids.

<div class="images"> </div>
<div id="slider"> </div>
<div class="blocks"> </div>
<div class="content"> </div>

i did try below code but it doesn't seem to be working for the elements withing the iframe

$(document).ready(function(){
    $('.content').slideDown(1000);
});

is there a specific way that i can apply the above code into a iframe?

any help will be appreciated

LiveEn
  • 3,193
  • 12
  • 59
  • 104
  • @LiveEn give this a shot! http://stackoverflow.com/questions/6316250/how-to-scroll-an-iframe-to-the-bottom-when-page-loads – kyle.stearns Apr 08 '13 at 17:23

1 Answers1

1

If you're trying to access the contents of the iframe from the parent, you can use:

$(document).ready(function(){
    $("#exframe").contents().find("body").find(".content").slideDown(1000);
});

And if you know they'll be <div>s, use this selector: div.content to make it more efficient.

Ian
  • 50,146
  • 13
  • 101
  • 111