$("#fool").click(function(e){};)
.click([eventData],handler(eventObject))
eventData A map of data that will be passed to the vent.
handler (event Object) handler A function to execute each time the event is triggered.
$('.abc').click(add_event);
function add_event(){}
$('some_selector').click{para1:'Hello', param2:'World'},cool_function);
function cool_function (event) {alert {event.data.param; alert (event.data.param2);}
$('.selector').click(function(){add_event('shot')});
$('.leadToScore').click(function(){add_event('shot')})
$('.selector').bind('click',{param:'shot'},add_event);
functioin add_event (event){event.data.param=='shot';}
$('.leadtoscore').click(add_event('shot'));
function add_event(param) {return function(){alert(param;}}
menu3.jsp
$('a[class="oe_menu_leaf"]').click(function(){
if(timeOut){clearTimeout(timeOut); timeOut=0;}
$(".oe_menu_leaf").css('color','');
$(".oe_menu_leaf").css('background-color','');
$(this).css('color','black');
$(this).css('background-color','#FDA352');
});
event Data
A map of data that will be passed to the event handler.
$("someSelector").click{
param1: "hello",
param2:"world"
}
$('.selector').bind('click',{param:'shot'},add_event);
function add_event(event){
//event.data.para=="shot";
}
$("#foo-ld").click(function(e){})
.click([event Data],handler(eventObject))
xxxxxxxxxxxxxxxxxxxxxxxxxxx
1
2
3
|
|
Now if we click on this element, the alert is displayed:
Handler for .click() called.
We can also trigger the event when a different element is clicked:
1
2
3
|
|
沒有留言:
張貼留言