0

In the middle of my page i have iframe that loads various maps based on user criteria. further down the page i have a number of buttons using the following code that will load a new map based on criteria into the iframe.

current code:

<input style='width:70px;height:28px' class='gegevens' type='button' value='View'
onclick='maps.location.href=\"maps/statsmap.php?q=" . $row['gegevenID'] . '&vID='
.$row['vID'] .'&aID='.$row['aID']."\"'>

with maps being the name of the iframe location.

what I'd like to be able to do, as the above buttons are much further down the page than the iframe with the map, is when the user clicks the button and the map reloads, I'd like for it to focus on the map thus autoscrolling? to the map.

I'm wondering is this is possible and how best to do so.

1 Answers1

0

I think this answer has what you are looking for

And you could just focus on the element by using jQuery .focus

If you have an element with id statsMap, the code below should do the trick.

 $("#statsMap").focus();
Community
  • 1
  • 1
migueldiab
  • 82
  • 1
  • 4
  • If you can post the relevant code snippets in the answer itself, that can be of help for future if in case that link goes off – RinoTom Sep 28 '13 at 14:39