Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1155 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Javascript :

Triggering an element's hover event via another element

Thread title: Triggering an element's hover event via another element
Reply    
    Thread tools Search this thread Display Modes  
08-06-2010, 03:01 AM
#1
Gaz is offline Gaz
Gaz's Avatar
Status: Request a custom title
Join date: Apr 2007
Location: UK
Expertise: Code & Programming
Software: Coda, TextMate, Sublime 2
 
Posts: 2,097
iTrader: 26 / 100%
 

Gaz will become famous soon enough Gaz will become famous soon enough

Send a message via Skype™ to Gaz

  Old

Just thought I could do it like this:

Code:
$(document).ready(function(){

	$(".forum").hover(
		function(){
			$(this).find("a").css("color", "fea228");
		},
		function(){
			$(this).find("a").css("color", "fe8300");
		}
	);

	$(".forum").click(function(){
	  	window.location=$(this).find("a").attr("href"); return false;
	});
			
});
Which a)is ugly, b)is repetitive and c)most importantly, doesn't work

Reply With Quote
Reply    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed