First rowAction is receiving the TR node. If you want to get the href
of the first a tag in row passed to rowAction it will need to look
something like this:
function rowAction(row) {
var href = $(row).find('a')[0].href;
alert('href');
};
Second I think you might want to use the hover event. The hover event
normalizes some of the problems with using a mouseover and a mouseout.
You can see the docs for it here: http://visualjquery.com/ > events >
hover
Here is what tableHover would look like using hover:
function tableHover( tableClass, hoverClass) {
$('.' + tableClass + 'tr').hover(
function() { // mouseover
$(this).addClass(hoverClass);
rowAction(this);
},
function() { // mouseout
$(this).removeClass(hoverClass);
}
);
};
This is untested but should work just fine ... hope that helps!
--
Brandon Aaron
On 9/29/06, Mungbeans <[EMAIL PROTECTED]> wrote:
>
> I have this function which changes the class of a row on mouseover:
>
> function tableHover( tableClass, hoverClass) {
> $("."+tableClass+" tr").mouseover(function(){
> $(this).addClass(hoverClass);
> rowAction(this); // NOT RIGHT
> }).mouseout(function(){
> $(this).removeClass(hoverClass);
> });
> }
>
> function rowAction(row) {
> var href= $(row).attr("href");
> //alert(href);
> }
>
> I'm attempting to get the href element for the first link it finds and then
> set that as the url for the entire row's on-click event.
>
> How do I get the rowAction() to take the value of the current row?
> --
> View this message in context:
> http://www.nabble.com/Passing-current-object-to-function-tf2360354.html#a6575927
> Sent from the JQuery mailing list archive at Nabble.com.
>
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/