jquery detect if event happened