Floating Effect

  You are currently not logged in. You can view the forums, but cannot post messages. Log In | Register

03-Feb-11 15:38
Greetings,

My name is Philip, I'm a novice designer putting together my first website (http://philipos.com). I'd like some help putting together a *fixed* floating social networking icon bar (like the one on elated.com). Also, I need to rig my twitter feed to do the same thing, except rather than staying fixed, I'd like it to transition smoothly, to move as the reader scrolls down the article on the home page (like outlined in this article - http://jqueryfordesigners.com/fixed-floating-elements/).

Thank you!


Philip
06-Feb-11 17:16
Hi Philip, welcome to Elated!

I wrote an article on this very topic recently:

http://www.elated.com/articles/css3-floating-follow-tab-with-rollover-effects/

Matt

--
Matt Doyle, Elated
3rd Edition of my jQuery Mobile book out now! Learn to build mobile web apps. Free sample chapter: http://store.elated.com/
08-Feb-11 20:54
Thanks Matt! I posted on another forum as well and someone referred me to the same tutorial! I went through the process; however, there are a few things that I'm not clear on -

- How do I add more squares to for more icons? I've edited the code in Dreamweaver to add a few more icons, but the design pane only shows six, the rest don't appear.

- Additionally, I'm having problems aligning my icons in terms of the background positions.

Here's my code -


<!doctype html>
<html lang="en">
<head>

<title>CSS3 Floating Follow Tab with Rollover Effects | Demo | Elated.com</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">

<style type="text/css">

/* The tab itself */

#followTab {

/* No bullets */
list-style: none;

/* Position and float the tab */
position: fixed;
z-index: 1;
right: 0;
top: 130px;

/* Give the tab width and padding */
width: 25px;
padding: 8px 5px;

/* Add the curved white border */
border: 3px solid #fff;
border-right: none;
-moz-border-radius: 10px 0 0 10px;
-webkit-border-radius: 10px 0 0 10px;
border-radius: 10px 0 0 10px;

/* Add the drop shadow */
-moz-box-shadow: 0 0 7px rgba(0, 0, 0, .6);
-webkit-box-shadow: 0 0 7px rgba(0, 0, 0, .6);
box-shadow: 0 0 7px rgba(0, 0, 0, .6);

/* Add the semitransparent gradient background */
background: rgba(239, 91, 10, .75);
background: -moz-linear-gradient(top, rgba(243, 52, 8, .75), rgba(239, 91, 10, .75));
background: -webkit-gradient( linear, left top, left bottom, from( rgba(243, 52, 8, .75) ), to( rgba(239, 91, 10, .75) ) );
background: linear-gradient(top, rgba(243, 52, 8, .75), rgba(239, 91, 10, .75));
filter: progid:DXImageTransform.Microsoft.Gradient( startColorStr='#c0f33408', endColorStr='#c0ef5b0a', GradientType=0 );
}

/* Items within the tab */

#followTab li {
margin: 9px 0 0 0;
line-height: 0;
}

#followTab li:first-child {
margin-top: 0;
}

/* General style for buttons within the tab */

#followTab a {
display: block;
width: 25px;
background-image: url("images/follow-tab-buttons-3.png");
}

#followTab a span {
display: none;
}

/* "Newsletter" button */

#followTab a.newsletter {
height: 25px;
background-position: 0 0px;
}

#followTab a.newsletter:hover {
background-position: 0 -27px;
}

/* "RSS" button */

#followTab a.rss {
height: 24px;
background-position: 0 -50px;
}

#followTab a.rss:hover {
background-position: 0 -76px;
}

/* "Twitter" button */

#followTab a.twitter {
height: 24px;
background-position: 0 -96px;
}

#followTab a.twitter:hover {
background-position: 0 -120px;
}

/* "Facebook" button */

#followTab a.facebook {
height: 24px;
background-position: 0 -144px;
}

#followTab a.facebook:hover {
background-position: 0 -168px;
}

/* "Youtube" button */

#followTab a.youtube {
height: 24px;
background-position: 0 -192px;
}

#followTab a.youtube:hover {
background-position: 0 -216px;
}

/* "Picasa" button */

#followTab a.picasa {
height: 24px;
background-position: 0 -240px;
}

#followTab a.picasa:hover {
background-position: 0 -264px;
}

/* "Apple" button */

#followTab a.apple {
height: 24px;
background-position: 0 -288px;
}

#followTab a.applek:hover {
background-position: 0 -312px;
}

/* "LinkedIn" button */

#followTab a.linkedin {
height: 24px;
background-position: 0 -336px;
}

#followTab a.linkedin:hover {
background-position: 0 -360px;
}

/* "Blogger" button */

#followTab a.blogger {
height: 24px;
background-position: 0 -384px;
}

#followTab a.blogger:hover {
background-position: 0 -408px;
}

</style>

<!--[if lt IE 7]>

<style type="text/css">

/* Band-aid for IE6 */

#followTab {
position: absolute;
}

</style>

<![endif]-->

<style type="text/css">

/* Add some margin to the page and set a default font and colour */

body {
margin: 30px;
font-family: "Georgia", serif;
line-height: 1.8em;
color: #333;
}

/* Set the content dimensions */

#content {
width: 800px;
padding: 50px;
margin: 0 auto;
display: block;
font-size: 1.2em;
}

#content h2 {
line-height: 1.5em;
}

/* Style the images */

img.inline {
position: relative;
display: block;
border: 1px solid #333;
margin: 5px 0 10px 0;
}

/* Header/footer boxes */

.wideBox {
clear: both;
text-align: center;
margin: 70px;
padding: 10px;
background: #ebedf2;
border: 1px solid #333;
}

.wideBox h1 {
font-weight: bold;
margin: 20px;
color: #666;
font-size: 1.5em;
}

</style>

</head>
<body>
<ul id="followTab">
<li><a class="newsletter" href="http://www.philipos.com" title="Subscribe to the newsletter"><span>Subscribe to the newsletter</span></a></li>
<li><a class="rss" href="http://www.philipos.com" title="Subscribe to Philipos.com's RSS feed"><span>Subscribe to Philipos.com's RSS feed</span></a></li>
<li><a class="twitter" href="http://twitter.com/pysolomon" title="Follow Philipos.com on Twitter"><span>Follow Philipos.com on Twitter</span></a></li>
<li><a class="facebook" href="http://www.facebook.com/pysolomon" title="Follow Philipos.com on Facebook"><span>Follow Philipos.com on Facebook</span></a></li>
<li><a class="youtube" href="http://www.youtube.com/pysolomon" title="Follow Philipos.com on YouTube"><span>Follow Philipos.com on YouTube</span></a></li>
<li><a class="picasa" href="https://picasaweb.google.com/pysolomon" title="Follow Philipos.com on Picasa"><span>Follow Philipos.com on Picasa</span></a></li>
<li><a class="Apple" href="http://www.philipos.com" title="Follow Philipos.com on Apple"><span>Follow Philipos.com on Picasa</span></a></li>
<li><a class="LinkedIn" href="http://www.linkedin.com/in/pysolomon" title="Follow Philipos.com on Picasa"><span>Follow Philipos.com on Picasa</span></a></li>
<li><a class="Blogger" href="http://www.pysolomon@blogspot.com" title="Follow Philipos.com on Picasa"><span>Follow Philipos.com on Picasa</span></a></li>
</ul>

</body>
</html>


[Edited by matt on 09-Feb-11 19:31]
09-Feb-11 19:37
Hi Philip,

Great to hear that other folks are talking about this tutorial.

First of all, please use the <> code button when posting code in the forum, it makes it much easier to read!

Personally I wouldn't use Dreamweaver (or any visual editor) to modify the HTML and CSS. It's fine for initial layouts but it can easily wreck things like your CSS classes if you're not careful.

Your class names in your HTML and CSS need to match exactly, including the case. For example. you have:


<li><a class="Apple" ...


and:


#followTab a.apple { ...



You also have:


#followTab a.applek:hover {


I'm guessing the 'k' shouldn't be there.

Cheers,
Matt

--
Matt Doyle, Elated
3rd Edition of my jQuery Mobile book out now! Learn to build mobile web apps. Free sample chapter: http://store.elated.com/
21-Feb-11 12:37
Yup, I figured it out. Thanks Matt!


Philip
http://philipos.com

 
New posts
Old posts

Follow Elated