Comments on: CSS3 Lavalamp Menu https://www.designlunatic.com/2012/03/css3-lavalamp-menu/ Just another WordPress site Tue, 03 May 2022 15:33:00 +0000 hourly 1 http://wordpress.org/?v=3.6.1 By: Tgrace https://www.designlunatic.com/2012/03/css3-lavalamp-menu/#comment-114 Tgrace Fri, 20 Apr 2012 01:56:00 +0000 http://www.designlunatic.com/?p=1037#comment-114 Thanks. I’ll try that out!

]]>
By: Alexandre Smirnov https://www.designlunatic.com/2012/03/css3-lavalamp-menu/#comment-113 Alexandre Smirnov Fri, 20 Apr 2012 01:51:00 +0000 http://www.designlunatic.com/?p=1037#comment-113 Well, the “:target” selector is used to “target” an element that is in the url.  For example, if you have a div named “test”, and the url has “#test” appended to it, this code will fire:
#test:target{
background: red;
}

So if you have a link pointing to “#test”, or you append “#test” to the url via javascript, the “:target” event for that “test” element will fire.

The thing is, “:target” doesn’t work with actual pages.  It only works with items appended to the current page.

Since you’re using wordpress, you could use this tutorial: http://www.vanseodesign.com/wordpress/hightlight-current-page-wordpress/

And adapt the code to work with the lavalamp menu.

Good luck!

]]>
By: Tgrace https://www.designlunatic.com/2012/03/css3-lavalamp-menu/#comment-112 Tgrace Fri, 20 Apr 2012 01:31:00 +0000 http://www.designlunatic.com/?p=1037#comment-112 I am trying this out in a wordpress site – but am hardcoding the menu. I don’t know about the :target pseudo class… Could you give me an example on how this is done?

]]>
By: Alexandre Smirnov https://www.designlunatic.com/2012/03/css3-lavalamp-menu/#comment-111 Alexandre Smirnov Thu, 19 Apr 2012 23:08:00 +0000 http://www.designlunatic.com/?p=1037#comment-111 Well, that’s one way to do it.  The simplest way would probably be to just use inline styles on the div depending on what page is active.  If you have a dynamically generated website, then there isn’t really a solution, since unfortunately “:target” doesn’t work with top level pages.

]]>
By: Tgrace https://www.designlunatic.com/2012/03/css3-lavalamp-menu/#comment-110 Tgrace Thu, 19 Apr 2012 21:36:00 +0000 http://www.designlunatic.com/?p=1037#comment-110 Wondering how then to trigger the slider to remain in the correct position for the current page — Does one have to create a separate style sheet then for each page, changing the left position of the slider accordingly?

]]>