How can I scroll an iframe from the inside using jquery?
I am using a shadowbox that generates an iframe to display product details on a page. Since the details page can be quite long, the client will need a More button that scrolls down the page (apparently the scrollbar to the right of the iframe is not enough).
Here is the code I tried to scroll the iframe:
$(document).ready(function()
{
$(".moreButton img").click(function() {
scrollbottom();
});
});
function scrollbottom() {
var x = 250; // this number is a temporary placeholder
var t = 500;
$("iframe").animate({ scrollTop: x }, t);
}
I've also tried using body instead of iframe, to no avail. Any ideas? Thanks!
+2
a source to share
4 answers