Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Help

  1. #1
    New to the CF scene
    Join Date
    Jun 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help

    Hi all,

    I am new to java and have read some tutorials from w3s. I have a table with hockey jersey numbers listed in the table. What I am looking to accomplish for my visitors when they click on the link with the corresponding number is to have all of the players that have worn that jersey slide open in a table like box below the actual table. For ex. when a visitor clicks on jersey number 1 a box would slide open revealing all of the players to wear jersey number 1. When the click on another number jersey 1 box would close and jersey "x" would open.

    I have some code but Im guessing there is a better way to acheive this. As well as a much more clean way to do this.

    I have attached what I am working with for code so far below as well as a link to a screen shot where I want the info to appear.

    Hopefully I am on the right track but looking for ways to improve it

    Here is the link to screen shot
    https://dl.dropbox.com/u/61582742/Untitled-2.jpg

    and here is code and html

    Code:
    $(function() {
    
    	// get a list of the hidden areas
    	// so you can hide them when toggling 
    	// individual views
    	var lists = $('.player-list');
    
    	// find all of the links inside of the
    	// table you're displaying
    	$('#jerseys a').click(function() {
    	
    		// get the link info
    		var link = $(this)
    			, target = link.attr('href');
    			
    		// hide all of the lists
    		lists.hide();
    			
    		// then show the specific list
    		$(target).show();
    		
    	});
    })
    Thanks in advance for guideance and help

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,980
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Despite the similar sounding names, Java is not the same as Javascript.
    Moving from Java forum to Javascript frameworks forum.

    Also, in the future please select a title that better describes the issue at hand.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •