30 should be fine, but if you find that startup time is an issue, you can
use a single event handler on a parent element (event delegation) instead.
With a large number of elements, that's much faster, so it's good to be
familiar with the technique.
Let's assume that only your link elements have the _link suffix on their
IDs. (If that's not the case, you could use something more unique.) And
let's assume that all of these links are contained inside an element whose
ID is "container".
Then you could handle all of your links with:
$('#container').click( function( event ) {
var match = event.target.id.match( /^(.*)_link$/ );
if( match )
$( '#' + match[1] ).hide();
});
That's probably about as easy as doing the individual event handlers, so you
may want to do it this way from the start.
-Mike
> Thanks Mike,
> that looks good...
> A bunch could be up to 30, would that be an issue?