On Dec 7, 2008, at 9:34 AM, Kayhadrin wrote:

Hi,

If .menuitem is a class you use to contain each link, and .menu is the
class that exactly defines a link, you could use:

$('.menuitem').click(function(){ // the whole menu item can be clicked
 $('a.menu', this).click(); // simulate a click on the link, which
should make the browser load the link's URL
});


Actually, I don't think that is going to work. Instead, you'll have to do something like this:

  $('td.menuitem').click(function(event) {
        window.location.href = $('a.menu', this).attr('href');
  });
});

See my related blog entry (just posted 2 minutes ago) and scroll down to the part about "Other Elements":

http://www.learningjquery.com/2008/12/quick-tip-click-table-row-to-trigger-a-checkbox-click

--Karl

____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com

Reply via email to