Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-24-2010, 02:37 PM   PM User | #1
Rebelj12a
New Coder

 
Join Date: Jan 2010
Location: Wisconsin
Posts: 24
Thanks: 2
Thanked 0 Times in 0 Posts
Rebelj12a is an unknown quantity at this point
jquery character selection

I've been using jquery a little while now, basically im trying to fade individual characters in a word when the mouse hovers over them. I do not recall seeing any selector that would allow this but i figured someone might have an idea.

Thanks in advance.
Rebelj12a is offline   Reply With Quote
Old 01-25-2010, 07:50 PM   PM User | #2
harbingerOTV
Senior Coder

 
Join Date: Jan 2005
Location: Memphis, TN
Posts: 1,765
Thanks: 8
Thanked 123 Times in 121 Posts
harbingerOTV will become famous soon enough
See if this doesn't start you on the right direction:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

<script type="text/javascript">

$(document).ready(function() {
/* start */

var str = $('.post p').html();
$('.post p').empty();

for (var i = 0, len = str.length; i < len; i++) {
    jQuery.each(str[i], function(index, item){
		$('.post p').append('<span>' + item + '</span>');  
    });
}

/* hover fade thingy */
	$('.post p span').each(function(int){
		$(this).bind('mouseover', function(){
			//if($(this).text() == 'b'){
				$(this).css({'opacity' : '0.4'});
			//}
		});
	});
/* end hover */

/* end */

	
});
</script>

<style type="text/css">
.post p span {
float: left;
padding: 5px;
}
</style>

</head>
<body>
<div class="post">
<p>abcdeabcde</p>
</div>
</body>
</html>
__________________
Stop making things so hard on yourself.
i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis
harbingerOTV is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:30 AM.


Advertisement
Log in to turn off these ads.