Questions tagged [unbind]

Remove a previously-attached binding to an IP address:port pair, naming context, event handler, communication channel, or other system object. See [tag:bind] for a partial list of the common uses of the bind/unbind concept.

360 questions
83
votes
4 answers

how to unbind all event using jquery

i can use this code to remove click event, $('p').unbind('click') but , has some method to remove all event ? has a method named unbindAll in jquery ? thanks
zjm1126
  • 34,604
  • 53
  • 121
  • 166
50
votes
6 answers

jQuery bind/unbind 'scroll' event on $(window)

I have this function: function block_scroll(key){ if (key) { $(window).bind("scroll", function(){ $('html, body').animate({scrollTop:0}, 'fast'); }); } else { $(window).unbind(); } } The first part…
o01
  • 5,191
  • 10
  • 44
  • 85
47
votes
4 answers

How to unbind a specific event handler

Code: $('#Inputfield').keyup(function(e) { if(e.which == 13) { functionXyz(); } else { functionZyx(); } }); …
MeProtozoan
  • 1,027
  • 3
  • 14
  • 26
41
votes
3 answers

Unbind view model from view in knockout

I'm looking for unbind functionality in knockout. Unfortunately googling and looking through questions asked here didn't give me any useful information on the topic. I will provide an example to illustrate what kind of functionality is…
ILya
  • 2,670
  • 4
  • 27
  • 40
27
votes
2 answers

first unbind click and then bind (jquery)

1.I have a onclick event on, $('#locations').click(function(){ $('#train').unbind('click'); //do some stuff } 2.Once the close button is clicked $('.close').click(function(){ //do some stuff } 3.Then again if I click #train…
Prithviraj Mitra
  • 11,002
  • 13
  • 58
  • 99
17
votes
3 answers

Android, unbind service and onServiceDisconnected problem

I'm not good in English, but I would try to explain my problem in good way. So, the problem is: 1) I have a local service 2) I start it and then bound to it. 3) Problem appears when I am about to close that service. onServiceDisconnected method from…
UAS
  • 405
  • 2
  • 4
  • 9
16
votes
3 answers

Are event listeners in jQuery removed automatically when you remove the element using .html()?

In jQuery if we use .remove() for removing some element, then all bound events and jQuery data associated with the elements are removed. But what happens if we "remove" the elements with .html()? Do we need to unbind all the elements prior to…
Enrique
  • 4,693
  • 5
  • 51
  • 71
16
votes
2 answers

Unable to unbind the window beforeunload event in Jquery

I have a page where the user can drag and drop objects and save them as an image.When a user navigates away from the page, the event beforeunload is fired. Now, this happens every time. What i want to do is, unbind the event if the user has saved…
bitblt
  • 217
  • 1
  • 3
  • 8
13
votes
3 answers

Cleanly binding/unbinding to a Service in an Application

I have an Android application that is binding to a persistent service (once started with startService()). The service is an integral part of the application and thus is used in almost every Activity. Hence I want to bind to the service just once…
Sven Jacobs
  • 6,278
  • 5
  • 33
  • 39
13
votes
4 answers

Remove jQuery tablesorter from table

I am using the jQuery tablesorter (http://tablesorter.com). After being applied to a table by $('#myTable').tablesorter(), how can I remove it again from the table?
psx
  • 4,040
  • 6
  • 30
  • 59
13
votes
2 answers

Unbind special keypress event

I've got a question regarding jQuery keypress events. I've got the following (working) code: $(document).bind('keypress', function(event) { if ($('#myDiv').is(':visible')) { if (event.which == 102) { // ...do something... …
Mikaelik
  • 355
  • 3
  • 4
  • 12
13
votes
3 answers

How do I "rebind" the click event after unbind('click')?

I have an anchor tag made into a "button". Sometimes, this tag needs to be hidden if there is nothing new to show. All works fine if I simply hide the button with .hide() and re-display it with .show(). But I wanted to…
Ben
  • 2,917
  • 10
  • 28
  • 47
13
votes
2 answers

How to bind, unbind and rebind (click) events in JQuery

After asking the same question 2 weeks ago here, I finally found "the" solution. This is why I am answering my own question. ;) HOW TO BIND, UNBIND AND REBIND EVENTS IN JQUERY?
John Doe Smith
  • 1,623
  • 4
  • 24
  • 39
13
votes
3 answers

Android - bindService more than once

Is it ok to use bindService more than once with the same context to the same service ? Can I use bindService multiple times with the same context to the same service and unBindService only once ? Thanks
refaelos
  • 7,927
  • 7
  • 36
  • 55
12
votes
1 answer

Backbone events firing twice

Why must I create a whole close prototype just to have my events unbinded from my view? Shouldn't Backbone just build that in? Is there a way to detect when a view is being removed? My backbone events fire twice after I navigate away and back to the…
Garrett
  • 11,451
  • 19
  • 85
  • 126
1
2 3
23 24