View Full Version : Scroll to Top script + Update Iframe? Maybe?

05-09-2012, 09:48 PM
1) Script Title: jQuery Scroll to Top Control v1.1

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex3/scrolltop.htm

3) Describe problem: Want to augment with an iframe update/refresh, if possible?

+++++++ hi all, newbie here, struggling! ++++++++++

I love the scroll to top script, it's working great for me.

I have a container HTML which loads a big long iframe which is automatically sized. You scroll down the container HTML to view the long iframe html and click the Scroll back to Top button to get back up to the top.

The problem is, I need to "refresh" the iFrame after somebody goes back to the top; the table at the top of the iframe ends up not being aligned correctly otherwise (it drops down a few rows).

I don't know how to do this. I want to add a refresh iframe command to the script, but I can't figure it out.

I see lots of examples from the web, but... I'm too lame to get them to work...

Can you help?

Here are some bits I found:

//reload 1 iframe

//reload all iFrames
$('iframe').each(function() {

<script type="text/javascript">
$(document).ready(function() {
$('#Button1').click(function() {

<iframe src="test.html" id="testFrame" width="100" height="343"><a href="test.html">Test</a></iframe>

<script type="text/javascript">
if (document.getElementById) {
document.write('<button id="reload">Reload</button>')
document.getElementById('reload').onclick = function () {testFrame.location.reload(1)}
// -->


I just can't... get it all working! I'm sorry... I feel lame.