I have some news links, when user moves on that I have to change text of paragraph containing news in details.
Asked
Active
Viewed 8,887 times
4 Answers
7
It's simple:
$('a.newslink').bind('mouseover', function() {
$('p#newsdetail').text('new text');
})

vtambourine
- 2,109
- 3
- 18
- 27
-
It's a string, whatever you want. Detailed news, for example. – vtambourine Jun 22 '10 at 08:27
2
Can you post some example code or what you are working with/what you have so far? Without that, I can only refer you to this page: http://api.jquery.com/mouseover/

Chris Laplante
- 29,338
- 17
- 103
- 134
-
I suspect the mouseenter and leave example from that link is what nectar wants. – Kathy Van Stone Jun 21 '10 at 19:36
1
see solution in action here: http://jsbin.com/asoka4/2
This is a really lazy way to do things =)
<script type='text/javascript'>
$( function() {
$("#news li").hover(
function () {
$(this).attr('small',$(this).html());
$(this).html($(this).attr('full'));
},
function () {
$(this).html($(this).attr('small'));
}
);
});
</script>
<ul id='news'>
<li id='news1' full='<strong>this is the full news 1</strong>'>This is some news 1</li>
<li id='news2' full='<del>This is the full news 2</del>'>This is some news 2</li>
<li id='news2' full='<a href="http://www.google.com">Check google.com for this one!'>This is some news 3</li>
</ul>

ruinernix
- 690
- 2
- 8
- 21