CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 22nd, 2013, 03:00 PM
Lemikonkon Lemikonkon is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 2 Lemikonkon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 19 sec
Reputation Power: 0
Active Link not staying active

Hi,

I'm trying to build a menu for my website which expands like an accordian menu on rollover. I've been able to get this to work, but now I am trying to get the menu item to stay expanded when it's clicked. Code below.

html
Code:
<div id="menu">
<ul class="accordion">

  <a href="web.php"><li class="slide-01">
		<div>  <p class="rotate">web</p></div>
  </li></a>

  <a href="graphic.php"><li class="slide-02">
    <div>  <p class="rotate">graphic</p>	</div>
  </li></a>

 <a href="interface.php"> <li class="slide-03">
    <div>  <p class="rotate">interface</p></div>
  </li></a>

  <a href="other.php"><li class="slide-04">
    <div>  <p class="rotate">other</p></div>
  </li></a>

  <a href="about.php"><li class="slide-05">
    <div> <p class="rotate">about</p>
    </div>
  </li></a>
  
  <a href="contact.php"><li class="slide-06">
    <div> <p class="rotate">contact</p></div>
  </li></a>

</ul>

</div>



css
Code:
.accordion li{
    float:left;
    width:10%;
    overflow:visible;
    height:50px;
	vertical-align:middle;
    -moz-transition:width 0.2s ease-out;
    -webkit-transition:width 0.2s ease-out;
    -o-transition:width 0.2s ease-out;
    transition:width 0.2s ease-out;
    -moz-transition-delay:0.15s;
    -webkit-transition-delay:0.15s;
    -o-transition-delay:0.15s;
    transition-delay:0.15s;
}

.accordion div{

}
.accordion:hover li{
    width:10%;
}
.accordion li:hover{
    width:46%;
}
.slide-01  { background:#4d00c0; color:white; }
.slide-02  { background:#116ad3; color:white; }
.slide-03  { background:#0dc847; color:white; }
.slide-04  { background:#d37a11; color:white; }
.slide-05  { background:#d311bd; color:white; }
.slide-06  { background:#1f11d3; color:white; }





I've tried using li:active (at the moment using a background colour because its easier to see) and that makes it change on click, but when it goes to the next page it's back to normal, I've also tried adding an "active" class to the link on the page (changing the li classes to id for this) but neither method seems to work. Can you help me out?

Reply With Quote
  #2  
Old January 22nd, 2013, 04:07 PM
Nanomech's Avatar
Nanomech Nanomech is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2011
Location: The Pleiades
Posts: 192 Nanomech User rank is Sergeant (500 - 2000 Reputation Level)Nanomech User rank is Sergeant (500 - 2000 Reputation Level)Nanomech User rank is Sergeant (500 - 2000 Reputation Level)Nanomech User rank is Sergeant (500 - 2000 Reputation Level)Nanomech User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 23 h 7 m 18 sec
Reputation Power: 7
Send a message via Skype to Nanomech
Hey dude,

Not really done this myself so I can't give any advice but I bookmarked this site a while ago: http://www.cardeo.ca/achieving-acti...tates-with-css/

Hope ths helps.

Regards,

NM.
__________________
"WERE NOT WORTHY!"
"WERE NOT WORTHY!"

Reply With Quote
  #3  
Old January 22nd, 2013, 08:12 PM
Lemikonkon Lemikonkon is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 2 Lemikonkon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 19 sec
Reputation Power: 0
Thanks for that link - it seems like switching the classes to ID and adding an _on to the active link id works to extend it - but now I have a whole new problem that I didn't consider:
is there a way to make the active link shrink back down when I hover over the other links - the extension effect + the long active link box is forcing the menu down onto two lines.

thanks in advance

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Active Link not staying active

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap