02-05-2010, 12:32 AM
|
#6 (permalink)
|
|
The Prestige
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
|
Quote:
Originally Posted by delayedinsanity
sketch? Where are youuuuu? SKETCH?! ;)
|
What? Whaaaat?! Im here!
without properly understanding your problem, its 00:30 atm so my brain isnt working fully!
Bit of jQuery magic:
javascript Code:
$(function(){ $('a.parent').click(function(e){ //stop browser from doing default action e.preventDefault(); //get parent class var classes = $(this).attr('class'); var index = classes.indexOf(' '); $('div.child.' + classes.substr(index + 1, (classes.length - index))).toggle(); }); })
Using this HTML:
html Code:
<a href="#" class="parent A">Click to toggle One</a> <a href="#" class="parent B">Click to toggle Two</a> <a href="#" class="parent C">Click to toggle Three</a> <a href="#" class="parent D">Click to toggle Four</a>
<div class="child A"> Child One </div> <div class="child B"> Child Two </div> <div class="child C"> Child Three </div> <div class="child D"> Child Four </div>
And a small bit of css:
css Code:
.child { display: none; background: #000; padding: 2em; color: #fff }
Is that what your after my dear friend? or have I completly mis-understood?! (which incidentally, wouldnt surprise me, me brains a bit low on the energy front)
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
Last edited by sketchMedia : 02-05-2010 at 12:47 AM.
Reason: removed some cruft
|
|
|
|