TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-08-2009, 02:26 PM   #1 (permalink)
The Wanderer
 
ebuoe's Avatar
 
Join Date: May 2009
Location: lagos, nigeria
Posts: 13
Thanks: 9
ebuoe is on a distinguished road
Default creating a taskbar with css

hw do you design an immovable box(like what facebook have at the foot of their page that contains chat and notification)such that it behaves like a taskbar and doesn't move when you scroll up and down using css.
ebuoe is offline  
Reply With Quote
Old 05-08-2009, 03:37 PM   #2 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

They tend to set the position to absolute and position it at the bottom of the window. Such as like with the following CSS code:

css Code:
position: absolute;
left: 0;
bottom: 0;
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 08-13-2009, 07:37 PM   #3 (permalink)
The Contributor
 
Join Date: Oct 2008
Posts: 75
Thanks: 4
9three is on a distinguished road
Default

Hi

I'm trying to figure out how to get it to work. If the content of the page is my resolution height then it works fine. But if its more than that and I scroll down, the bar will not move. Basically I need it to "stick" to the bottom of the page. Not sure if I would need to us javascript to determine whether the user is at the initial starting point of the page or scrolling.

tool bar code:
Code:
/* Toolbar */
#toolbar {
  position: absolute;
  width: 100%;
  height: 20px;
  margin: 0px;
  padding: 5px 0px 0px 0px;
  left: 0px;
  bottom: 0px;
  border-top: 2px solid #b5b5b5;
  background: #e5e5e5;
}
I've set the tool bar under and outside my wrapper
Code:
#wrapper 
{
  position: relative;
  margin: 0 auto;
  padding: 0px;
  width: 1000px;
}
Here is the html:

Code:
<div id="wrapper">
  <div id="header">
    header
  </div>
  <div id="content">
    content
  </div>
  <div id="footer">
    <div class="copyright">
      copyright
    </div>
  </div>
</div>

<div id="toolbar">
  <div class="content">Tool bar</div>
</div>
9three is offline  
Reply With Quote
The Following User Says Thank You to 9three For This Useful Post:
ebuoe (08-31-2009)
Old 08-19-2009, 05:57 PM   #4 (permalink)
The Wanderer
 
Join Date: Aug 2009
Posts: 17
Thanks: 0
Rhinos is on a distinguished road
Default

Ok this is right out of the facebook CSS (I used firebug to inspect the bottom bar):

Code:
body #presence {
  bottom: 0;
  color: #111111;
  font-size: 11px;
  height: 25px;
  padding: 0;
  position: fixed;
  right: 0;
  width: 100%;
  z-index: 99;
}
What you see here is that instead of using absolute positioning, they use fixed positioning. This will keep it in place regardless of scrolling.

The z-index is used so that it stays above the other content on the page (and any embedded flash that may be on the page).

On facebook they also have another div inside the div that uses the above code that is 100% width and uses a margin to make the gaps on the left and right of the bar.
Rhinos is offline  
Reply With Quote
The Following User Says Thank You to Rhinos For This Useful Post:
ebuoe (08-31-2009)
Old 08-20-2009, 01:10 PM   #5 (permalink)
The Contributor
 
Join Date: Nov 2008
Location: Sweden
Posts: 36
Thanks: 1
hjalmar is on a distinguished road
Default

Quote:
Originally Posted by Rhinos View Post
Ok this is right out of the facebook CSS (I used firebug to inspect the bottom bar):

Code:
body #presence {
  bottom: 0;
  color: #111111;
  font-size: 11px;
  height: 25px;
  padding: 0;
  position: fixed;
  right: 0;
  width: 100%;
  z-index: 99;
}
What you see here is that instead of using absolute positioning, they use fixed positioning. This will keep it in place regardless of scrolling.

The z-index is used so that it stays above the other content on the page (and any embedded flash that may be on the page).

On facebook they also have another div inside the div that uses the above code that is 100% width and uses a margin to make the gaps on the left and right of the bar.
They prob have a conditional comment or css hack directly in the css as fixed positioning isn't supported in internet explorer. And about the z-index overlapping flash is depending on how the flash itself is displayed.

To the thread starter, just put position: relative; on your body
hjalmar is offline  
Reply With Quote
The Following User Says Thank You to hjalmar For This Useful Post:
ebuoe (08-31-2009)
Old 08-20-2009, 06:08 PM   #6 (permalink)
The Wanderer
 
Join Date: Aug 2009
Posts: 17
Thanks: 0
Rhinos is on a distinguished road
Default

Yes in the internet explorer 6 you must use javascript or at least a CSS hack.
Facebook no longer supports ie6 so it doesn't use any javascript or CSS hacks to position it's 'presence' bar as they call it.

It will work in IE7 if you use a Strict doctype. Also another point is that if you use the Strict doctype then the :hover css will work on table rows and other elements. It doesn't work on Transitional doctypes (you'll have to use javascript again to simulate the hover events).
Rhinos is offline  
Reply With Quote
The Following 2 Users Say Thank You to Rhinos For This Useful Post:
ebuoe (08-31-2009), ScottRiley (09-29-2009)
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Simple Currency Converter with Automatic Symbols Wildhoney General 11 03-16-2010 05:22 PM
Creating a function? code_junkie Advanced PHP Programming 6 02-11-2009 09:10 PM
Creating directory hierarchies with ease Wildhoney Script Giveaway 3 12-04-2008 02:28 AM
Creating custom php extensions with DevCPP? Nor Advanced PHP Programming 6 01-30-2008 04:49 PM
Creating a PHP ACL and even Rat out Users using Proxies! Wildhoney General 0 09-22-2007 10:48 AM


All times are GMT. The time now is 06:58 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design