1

I have this asp.net page as below.

<body>
    <form id="form1" runat="server">
    <div class="page" >
    <iframe id="iFrame1" style="width:100%" runat="server" 
    height="1100"  scrolling="yes"
    src="login.aspx"
     frameborder="0" align="left">
    </iframe>
    </div>
    </form>
</body>

To scroll the iframe,I have to put the mouse pointer over the IE scroll bar. I just want to place the mouse pointer over the iframe and scroll the page.Please advice. thanks in advance.

TNA
  • 616
  • 1
  • 9
  • 25
  • 1
    Have a look here: http://stackoverflow.com/questions/7303948/how-to-auto-scroll-to-end-of-div-when-data-is-added/7303972#7303972 – Valamas Sep 12 '12 at 03:42

1 Answers1

1

Here is a jQuery solution:

<div id="pane" style="width: 300px; height: 200px; overflow: auto;">
   <iframe id="iFrame1" width="800" height="600" src="login.aspx" scrolling="no">
   </iframe>
</div>

<script type="text/javascript">
$("#pane").hover(function()
{
  $("#pane").scrollTop(400).scrollLeft(400);
  return false;
});
</script>

For smoother scrolling you can use the jquery animate function.

nunespascal
  • 17,584
  • 2
  • 43
  • 46