[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Disabling the scroll bars of parent page

Posted on 2009-02-19
7
Medium Priority
?
571 Views
Last Modified: 2012-05-06
Experts is it possible to disable the scroll bars of a parent page to IFRAME in .aspx page...?
I thought  window.parent.document.style.overflow=hidden;  would work, but it does not.
0
Comment
Question by:dotnetpro
  • 4
  • 3
7 Comments
 
LVL 16

Expert Comment

by:sunithnair
ID: 23685143
You can do the following in the parent page
<body style="margin: 0; overflow: hidden;" scroll="no">

Open in new window

0
 
LVL 1

Author Comment

by:dotnetpro
ID: 23685267
My question was not quite clear. I am actually looking for a way to hide the scroll bars when i click on a hyperlink on the parent page to open a new page in IFRAME and scroll bars to appear back again when i close the pop up iframe window
0
 
LVL 16

Expert Comment

by:sunithnair
ID: 23685349
try this
window.parent.document.body.style.overflow="hidden";

Open in new window

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:dotnetpro
ID: 23685819
Nope it did not ..
0
 
LVL 16

Expert Comment

by:sunithnair
ID: 23685907
Can you paste your code here so that i can have a look at it?
0
 
LVL 1

Author Comment

by:dotnetpro
ID: 23692922
I am afraid i do not have code for disabling the scrollbars yet...but that is what i am trying to do.
I have a parent page in which i have placed an IFRAME. I have placed an href on the parent page , when clicked opens the targeted page in HREF. I have attached the code snipped at bottom. I am not sure if it would be enough.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="IndexPage.aspx.cs" Inherits="IndexPage" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Home Page</title>    
</head>
<body id="body1" runat="server">
    <form id="form1" runat="server">
        <!--
		The masthead area. Will contain flash applet
	-->
        
        <!--
		Main Content
	-->
        <div id="content">
            <!--
			Row
		-->
            <div class="row">
                <div class="column double">
                    <div class="how_we_can_help">
                        <a href="IndexPage.aspx?search=1" class="thickbox">                           
                                
                            <div class="clear">
                            </div>
                        </a>
                    </div>
                </div>
                <div id="greypage" style="z-index: 4; position: absolute; top: 0px; left: 0px; width: 100%;
                    height: 100%; background-color: #8B8682; visibility: hidden; filter: alpha(opacity=60);
                    opacity: 0.75;" runat="server"></div>
                <div id="previewloading" style="display: none; width: 800px; position: absolute;
                    top: 35px; height: 510px; white-space: nowrap; background-color: white; text-align: center;
                    z-index: 1000; right: 9%; position: absolute; left: 200px;" align="center" runat="server">
                    <iframe height="510px" scrolling="auto" width="800px" frameborder="0" id="ifrmsearch" 
                        runat="server" style="height: 510px; position:relative; margin:auto;" src="Content/Search/AdvanceSearch/AdvanceSearch.aspx">
                    </iframe>
                </div>
                
    </form>
</body>
</html>

Open in new window

0
 
LVL 1

Accepted Solution

by:
dotnetpro earned 0 total points
ID: 23785963
I got this one to working by altering the style sheet and providing an onscroll event handler for the parent window.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month18 days, 12 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question