I was wondering if it is possible to do something like this with jQuery:
$('#embedVid' || '#upldImg').click(function() {
slide($('.vidEmbd') || $('#image_uploader_wrapper'));
});
ie. if '#embedVid' is clicked, then pass '$('.vidEmbed')' to the 开发者_开发百科function 'slide', OR, if '#upldImg' is clicked, then pass '$('#image_uploader_wrapper')' to 'slide'?
It'd be nice if I could put them in one click function...
Thanks
you could put the target class as the rel attribute of the object...
$('#embedVid,#upldImg').click(function() {
slide($($(this).attr('rel')));
});
with:
<span id='embedVid' rel='.vidEmbd'>Some Text</span>$(
精彩评论