Solved

How could I pull this off?

Posted on 2011-02-25
6
255 Views
Last Modified: 2012-08-13
Attached is a screen shot of a webpage I'm putting together. What I want to do is have the white section be "scroll-able" while the top and side navigation elements remain stationary.

At first I was thinking I could use frames, but then I stopped when I went back and realized that framing uses the whole browser and that's not what I'm doing here.

And that's when I thought that something in the context of a CSS approach could work and that's my question.

Could I use CSS to allow for one cell in a table to scroll while the other cells remain stationary? How would I do that? Screen shot of web design Screen shot of web design
0
Comment
Question by:brucegust
  • 2
  • 2
  • 2
6 Comments
 
LVL 16

Expert Comment

by:SSupreme
ID: 34983616
You can use positioning and layering to complete your task, position:fixed for element you what to fix and upper layer.
0
 
LVL 4

Accepted Solution

by:
LAMASE earned 500 total points
ID: 34983828
In other words you need to have only the central part scrollable, isn't it? Is the simplest thing and avoids you lot of problems with fixed positioning

If the central part is for example

<div id="main">
....
</div>

Open in new window


just simply use

#main {
height: 400px;
overflow: auto;
}

Open in new window


You  will need to adjust the height of the main div, (you have to do this even in the @Suppreme solution for the left bar), and you can do this with javascript (jQuery is a good choice)


P.S. However, in my opinion, you are cutting out some space for the user, just let him scroll and view the content in the whole page
0
 

Author Comment

by:brucegust
ID: 34983906
OK, so I've got a table with my nav bar on the left and my header up top with the portion of the screen that I want my user to scroll in the middle. If I've positioned my table in the middle of the screen, I'm thinking the cells within the table itself will adequately position things the way that I need them to appear.

So, that means that all I need to do is make the cells that harbor the navigation elements are assigned a fixed value while the cell that has the content - that's assigned a class scrolls, correct?

What I want to do is have the portion that scrolls have a scroll bar running along the side. I just don't want a huge white body of text running ad nauseam down the side of my screen. Can you see what I'm going for in your mind's eye? Does the "fixed" dynamic you suggested accommodate my vision, or am I barking up the wrong tree?
0
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 
LVL 16

Expert Comment

by:SSupreme
ID: 34983983
0
 
LVL 4

Expert Comment

by:LAMASE
ID: 34984076
In this way you will have scrollbars along the entire page, not only the content part, keep in mind. Using a fixed height and overflow: auto; for the content you will have scrollbars only in that part: choose your favourite.
0
 

Author Comment

by:brucegust
ID: 34989288
Guys, I think we're poised on the threshold of great things, but even after a couple of hours of trying to make this work, I'm coming up short.

My code is attached. The area that I want to scroll is preface with <!-THIS IS THE AREA THAT I WANT TO SCROLL. EVERYTHING ELSE NEEDS TO REMAIN STATIONARY. HOW? -> It's the body graphic.

Your suggestions look positively accurate, but I'm having difficulty seeing how you would assign those properties to specific cells. Could you give me some example of how I would assign a particular cell in a table a property that keeps it in place while the content of another cell is scrollable?
<?php
require_once('artist_info.php');
require_once('header.php'); 
?>

<body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- Save for Web Slices (web_mockup.psd) -->
<table width=100%>
<tr>
<td>
&nbsp;<BR>
</td>
</tr>
<tr>
<td align="center">
	<table id="Table_01" width="1200" height="799" border="0" cellpadding="0" cellspacing="0" align="center">
	<tr>
	<td colspan="2">
	<?php require_once('satellite_top_nav.php'); ?></td>
	</tr>
	<tr>
	<td class="one">
		<table width="223" height="558" cellspacing="0" cellpadding="0">
		<tr>
		<td valign="top">
		<script language="JavaScript" type="text/javascript">
		AC_FL_RunContent(
		'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
		'width', '223',
		'height', '372',
		'src', 'satellite_left_nav',
		'quality', 'high',
		'pluginspage', 'http://www.adobe.com/go/getflashplayer',
		'align', 'middle',
		'play', 'true',
		'loop', 'true',
		'scale', 'showall',
		'wmode', 'window',
		'devicefont', 'false',
		'id', 'satellite_left_nav',
		'bgcolor', '#ffffff',
		'name', 'satellite_left_nav',
		'menu', 'true',
		'allowFullScreen', 'false',
		'allowScriptAccess','sameDomain',
		'movie', 'satellite_left_nav',
		'salign', ''
		); //end AC code
		</script>
		<noscript>
			<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" 
			width="223" height="372" id="satellite_left_nav" align="middle">
			<param name="allowScriptAccess" value="sameDomain" />
			<param name="allowFullScreen" value="false" />
			<param name="movie" value="satellite_left_nav.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed src="satellite_left_nav.swf" quality="high" 
			bgcolor="#ffffff" width="223" height="372" name="satellite_left_nav" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" 
			pluginspage="http://www.adobe.com/go/getflashplayer" />
			</object>
		</noscript>
		</td>
		</tr>
		<tr>
		<td valign="top"><IMG SRC="images/satellite_left_nav_bottom.jpg"></td>
		</tr>
		</table></td>
		<!-THIS IS THE AREA THAT I WANT TO SCROLL. EVERYTHING ELSE NEEDS TO REMAIN STATIONARY. HOW? ->
	<td rowspan="2" bgcolor="white" background="images/sliced_satellit_03.gif" width="977" height="560" ><!-this is your body graphic ->
	</td>
	</tr>
	<tr>
	<td><!-this is something random ->
	<img src="images/sliced_satellit_04.gif" width="223" height="2" alt=""></td>
	</tr>
	<tr>
	<td colspan="2">
	<!-this is your footer graphic ->
	<img src="images/sliced_satellit_05.gif" width="1200" height="30" alt=""></td>
	</tr>
	</table>
</td>
</tr>
</table>

</body>
</html>

Open in new window

0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

777 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