I have for example:
$('#field').click(function(){
alert('One');
alert('Two');
})
and i would like use trigger:
$('#field').trigger('click');
is possible to add function for this?
If i use trigger i would like execute only alert(‘One’);
Maybe as…
$('#field').click(function(){
alert('One');
if(this != trigger){
alert('Two');
}
})
Not sure I understand you correctly, but you can pass variables to the trigger using the second argument:
http://jsfiddle.net/t5nZz/