View Single Post
01-02-2010, 11:19 AM
#1
Dan is offline Dan
Dan's Avatar
Status: Request a custom title
Join date: Feb 2005
Location:
Expertise:
Software:
 
Posts: 3,164
iTrader: 15 / 86%
 

Dan is an unknown quantity at this point

  Old  Styled Radios using jQuery & CSS

Example

Have a play with both the checkbox and radio sections to notice the problem.

I'm trying to remove the fakeradioed class from all radios that are unselected by another radio being selected.

Code:
$(document).ready(function(){
		// check for what is/isn't already checked and match it on the fake ones
		$("input:radio").each( function() {
			(this.checked) ? $("#fake"+this.id).addClass('fakeradioed') : $("#fake"+this.id).removeClass('fakeradioed');
		});
		// function to 'check' the fake ones and their matching checkboxes
		$(".fakeradio").click(function(){
			($(this).hasClass('fakeradioed')) ? $(this).removeClass('fakeradioed') : $(this).addClass('fakeradioed');
			$(this.hash).trigger("click");
			return false;
		});
	});
Any suggestions on how i can fix this?

Reply With Quote