Avatar of purpleFringe
purpleFringe
Flag for Lebanon

asked on 

Scrolling Div in an IFrame: Safari strange problem

Good evening. This is my first post here. I have come across your nice solution about the div that scrolls horizontally in an Iframe, and does not scroll vertically (that is, is fixed vertically but still moves as is with the page when scrolling is horizontal).

Everything worked amazingly well in both firefox and IE, but a problem occurred on Safari. The strange part is that the div works as expected in the IFrame itself, but when loading the parent of the IFrame, the div is just positioned without any other effect on the scroll motions. The following is the div in the Iframe page, say Default.aspx.  I equally tried the other posted code in the related post.

Again it works well in IE, firefox, and in Safari's IFrame page itself (Default.aspx) but not in the parent page that contains the IFrame! If you can help me as soon as possible, I'd be very grateful. Thanks in advance.


<div id="Hello" style="z-index: 104;position:absolute;">
 
<asp:Panel  CssClass="BorderBAround1" Width="150" BackColor="#f7f7f7" ID="P1" runat="server">
<asp:table   CssClass ="centerTable" id="tbList" HorizontalAlign="center"  runat="server" width="130" CellPadding="0" CellSpacing="0" GridLines="Horizontal">
</asp:table>
</asp:Panel>
 
</div>
 
 
function move(){
// if (window.event)
//  {
  var ns = navigator.appName;
  //document.getElementById('Hello').style.top = 100 + 'px';
   
      // alert(ns);
      if(ns == "Netscape")
      {
      document.getElementById('Hello').style.marginLeft = window.scrollX + 'px';
      document.getElementById('Hello').style.top = 33 + 'px';
      }
      else
      {
       document.getElementById('Hello').style.marginLeft = document.documentElement.scrollLeft + 'px';
       document.getElementById('Hello').style.top = 25 + 'px';
      }
}

Open in new window

CSSJavaScriptHTML

Avatar of undefined
Last Comment
purpleFringe

8/22/2022 - Mon