Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-26-2012, 12:00 AM   PM User | #1
GreenFanta
New Coder

 
Join Date: Aug 2011
Posts: 46
Thanks: 9
Thanked 2 Times in 2 Posts
GreenFanta is an unknown quantity at this point
Fixed Elements next to eachother

Hello Friends!

Basically I'm making a navigation bar and due to Jquery doing a lot of resizing to make a website look 'pretty' I don't want to use a horizontal list and so each button is created like so:

Code:
<a href="#" class="button" id="home"><img src="homeicon.png"><span id="homex"><br /><img src="home.png" /></span></a>
(yes they're all image buttons for good reason)

but the only problem is they're fixed and set to "top 0" at the top of the page and as a result cannot sit next to each other but rather overlap, any idea on how I can I still keep the position to fixed and they top to 0 yet keep them next to each other?

HTML
Code:
<div id="top">
<a href="#" class="button" id="home"><img src="homeicon.png"><span id="homex"><br /><img src="home.png" /></span></a>
</div>
CSS
Code:
#top a.button { position: fixed; top: 0; padding: 12px; background: url('glacial_ice.jpg'); text-decoration: none; color: black; border-radius: 0px 0px 25px 25px; }
#top { position: relative; top:0; padding-left: 25px; }
Init function (runs on $(document).ready())
Code:
	$('a.button').animate({
			height: '+=5px',
		  }, 20, function() {
	$('a.button').animate({
			opacity: 0.6,
			height: '-=5px',
		  }, 20);
		  });
Thanks
GreenFanta is offline   Reply With Quote
Old 09-26-2012, 12:02 AM   PM User | #2
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 453 Times in 451 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
... and this is not a css question why?
xelawho is offline   Reply With Quote
Old 09-26-2012, 12:07 AM   PM User | #3
GreenFanta
New Coder

 
Join Date: Aug 2011
Posts: 46
Thanks: 9
Thanked 2 Times in 2 Posts
GreenFanta is an unknown quantity at this point
It is a CSS Question, sorry about that, must've selected the wrong section by mistake.
GreenFanta is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:22 PM.


Advertisement
Log in to turn off these ads.