Search Results

Search found 185 results on 8 pages for 'unbind'.

Page 1/8 | 1 2 3 4 5 6 7 8  | Next Page >

  • jQuery unbind does not work

    - by aximili
    My unbind does not work. $("img.hoverable").hover(ChangeImage, ChangeBack); $("a img.hoverable").unbind('hover'); The HTML could be something like this <img class="hoverable" src="something.jpg"/> <a href="#"><img class="hoverable" src="something.jpg"/></a> When I hover over the second HTML, ChangeImage is still fired. I am not sure if I am using it correctly, can anyone please advise?

    Read the article

  • remove/unbind hover on anchors...

    - by Reigel
    html <a href="home.html">Home</a> css a { color: blue; } a:hover { color: red; } now as you can see <a> now would be color red on hover. Question How do I remove hover via jQuery? I have tried: $('a').unbind('hover'); and $('a').unbind('mouseenter mouseleave') I come to think why it won't work, is this not hover()? Please enlighten me... thanks

    Read the article

  • How to "unbind" a socket programmatically?

    - by ryan1894
    1) The socket doesn't seem to unbind from the LocalEndPoint until the process ends. 2) I have tried the solutions from the other question, and also tried waiting a minute - to no avail. 3) At the moment I have tried the below to get rid of the socket and its connections: public static void killUser(User victim) { LingerOption lo = new LingerOption(false, 0); victim.connectedSocket.SetSocketOption(SocketOptionLevel.Socket,SocketOptionName.Linger, lo); victim.connectedSocket.Shutdown(SocketShutdown.Both); victim.connectedSocket.Disconnect(true); victim.connectedSocket.Close(); clients.RemoveAt(victim.ID); } 4) After a bit of googling, I can't seem to be able to unbind a port, thus if I have a sufficient amount of connecting clients, I will eventually run out of ports to listen on.

    Read the article

  • Rebind a unbind click

    - by Antonio Ortiz
    I am using this library that allows you to create a more elegant alert box (you can even use images!); I used it with a click function and it works! A nice container opens with a close button, GREAT! I noticed if you happen to click more than once on the link you assigned, it keeps firing. So multiple images begin to propagate. I used the unbind method, but it cancels the link permanently (until refresh etc.). I was surprised to see the library doesn't compensate for this little problem, so I am wondering if you could rebind the click when you close the image window so it starts from the beginning. $(".shopFrag").click(function(){ Messi.img("_images/wishlist.jpg"); $(".shopFrag").unbind('click'); });

    Read the article

  • Unbind Key Presses

    - by Doug
    I'm making a game that involves, like all games, key presses. Only left and right arrow and the Space Bar. They work, but the browser is pre-set to scroll left, right, or jump down on those keys. Is there any way to unbind those keys in the code? Thanks.

    Read the article

  • Jquery – Disable/unbind click on active items, rebind click when inactive

    - by j-man86
    I have a left-positioned navigation that shows/hides content on the right. Currently, when you click a link, it fades in the corresponding content on the right and adds an active class to that link. My problem is that if you click the active link again, the content on the right keeps on fading in again. I would like to unbind that click while the link is active, and if you click on another navigation link (subsequently removing the class from the previous link and adding it to the current one) rebind the click event to all inactive links. Here is my current code: $('.mixesSidebar ul li').click( function() { //Get the attribute id var liId = $(this).attr('id'); //removeClass active from all li's, addClass active to this $('.mixesSidebar ul li').removeClass('active'); $(this).addClass('active'); //Hide all content on the right $('.mixesContent ul').hide(); //Find the content with the same class as the clicked li's ID, and fadeIn $('.mixesContent').find('.' + liId).fadeIn('slow'); }); Thanks so much for your help!

    Read the article

  • How should I unbind and delete OpenAL buffers?

    - by Joe Wreschnig
    I'm using OpenAL to play sounds. I'm trying to implement a fire-and-forget play function that takes a buffer ID and assigns it to a source from a pool I have previously allocated, and plays it. However, there is a problem with object lifetimes. In OpenGL, delete functions either automatically unbind things (e.g. textures), or automatically deletes the thing when it eventually is unbound (e.g. shaders) and so it's usually easy to manage deletion. However alDeleteBuffers instead simply fails with AL_INVALID_OPERATION if the buffer is still bound to a source. Is there an idiomatic way to "delete" OpenAL buffers that allows them to finish playing, and then automatically unbinds and really them? Do I need to tie buffer management more deeply into the source pool (e.g. deleting a buffer requires checking all the allocated sources also)? Similarly, is there an idiomatic way to unbind (but not delete) buffers when they are finished playing? It would be nice if, when I was looking for a free source, I only needed to see if a buffer was attached at all and not bother checking the source state. (I'm using C++, although approaches for C are also fine. Approaches assuming a GCd language and using finalizers are probably not applicable.)

    Read the article

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

    - by Ben
    I have an anchor tag <a class="next">next</a> 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 uses .fadeIn() and .fadeOut() instead. The problem I'm having is that if the user clicks on the button during the fadeOut animation, it can cause problems with the logic I have running the show. The solution I found was to unbind the click event from the button after the original click function begins, and then re-bind it after the animation is complete. $('a.next').click(function() { $(this).unbind('click'); ... // calls some functions, one of which fades out the a.next if needed ... $(this).bind('click'); } the last part of the above example does not work. The click event is not actually re-bound to the anchor. does anyone know the correct way to accomplish this? I'm a self-taught jquery guy, so some of the higher level things like unbind() and bind() are over my head, and the jquery documentation isn't really simple enough for me to understand.

    Read the article

  • Cannot Unbind Super Key from Unity

    - by Tom Thorogood
    Due to a graphics card compatibility issue using CrunchBang, I was told that my best option would be to move to 12.04 LTS. I'm trying to get everything configured and personalized the way I'm used to things, but am having some issues with unbinding default Unity shortcuts. I'm used to having all my shortcuts routed through the super key (T for Terminal, W for Web, Up for increased opacity, and so on). I've followed instructions to install compizconfig-settings-manager, and did an advanced search for all keyboard shortcuts binding to the super key, including the Unity shortcuts, but Unity still seems to listen for that keypress, and thus neither compiz nor the keybindings set up in system prefs - keyboard receive the commands I give them. (I did try also to simply change the unity launcher key instead of disabling it as shown below -- neither worked)

    Read the article

  • tmux: unbind C-[ as a prefix

    - by StanAngeloff
    I have a fairly straight forward .tmux.conf file which does nothing more but to define a couple of options, such as history-limit. I have not added any custom key bindings yet. I find it extremely annoying that I cannot unbind C-[ as a prefix in tmux. Here is what I mean: $ uname -a Linux stan-inspiron 3.2.0-24-generic #39-Ubuntu SMP Mon May 21 16:52:17 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux $ tmux [0] 0:~* "stan-inspiron" 10:05 12-Jun-12 % vim Whilst inside vim, when I go to insert mode and then use C-[0 to escape insert mode and move to the first character on the line, tmux grabs the key first and complains: Window not found: :0 ** I tried all sorts of things in my .tmux.conf, but nothing works. I thought it might be a terminal or shell issue, but confirmed same behaviour on a configless machine using Bash and [Gnome] Terminal. So the question really is, how do I unbind the C-[ key from tmux? ** I have base-index 1 set.

    Read the article

  • How to “unbind” .result on Jquery Autocomplete?

    - by Cesar
    I have this code: $("#xyz").unautocomplete().autocomplete(dataVar, { minChars: 0, width: 400, matchContains: true, highlightItem: true, formatItem: formatItem, formatResult: formatResult }) .result(findValueCallback).next().click(function() { $(this).prev().search(); }); I call this code many times and the first call works correctly, but after he calls findValueCallback many times, not once more. The unautocomplete don't clear .result What I have to do for call findValueCallback once? Sample Code: var niveis01 = []; var niveis02 = []; var niveis03 = []; $(document).ready(function(){ carregaDadosNivel1(); }); function carregaDadosNivel1() { $.ajax({ url: "http://.....", cache: true, type: "POST", dataType:"json", success: function(data){ ... niveis01 = data; habilitaComboNivel1(); ... }, error: function(xhr, ajaxOptions, thrownError){ ... } }); } function habilitaComboNivel1() { function findValueCallback1(event, data01, formatted) { ... carregaDadosNivel2(); ... } $("#nivel01").unautocomplete().autocomplete(niveis01, { minChars: 0, width: 400, matchContains: true, highlightItem: true, formatItem: formatItem, formatResult: formatResult }).result(findValueCallback1).next().click(function() { $(this).prev().search(); }); } function carregaDadosNivel2() { $.ajax({ url: "http://.....", cache: true, type: "POST", dataType:"json", success: function(data){ ... niveis02 = data; habilitaComboNivel2(); ... }, error: function(xhr, ajaxOptions, thrownError){ ... } }); } function habilitaComboNivel2() { function findValueCallback2(event, data02, formatted) { ... carregaDadosNivel3(); ... } $("#nivel02").unautocomplete().autocomplete(niveis02, { minChars: 0, width: 400, matchContains: true, highlightItem: true, formatItem: formatItem, formatResult: formatResult }).result(findValueCallback2).next().click(function() { $(this).prev().search(); }); } function carregaDadosNivel3() { $.ajax({ url: ""http://.....", cache: true, type: "POST", dataType:"json", success: function(data){ ... niveis03 = data; habilitaComboNivel3(); ... }, error: function(xhr, ajaxOptions, thrownError){ ... } }); } function habilitaComboNivel3() { function findValueCallback3(event, data03, formatted) { ... } $("#nivel03").unautocomplete().autocomplete(niveis03, { minChars: 0, width: 400, matchContains: true, highlightItem: true, formatItem: formatItem, formatResult: formatResult }).result(findValueCallback3).next().click(function() { $(this).prev().search(); }); }

    Read the article

  • Non-Dom Element Event Binding with jQuery

    - by Rick Strahl
    Yesterday I had a short discussion with Dave Reed on Twitter regarding setting up fake ‘events’ on objects that are hookable. jQuery makes it real easy to bind events on DOM elements and with a little bit of extra work (that I didn’t know about) you can also set up binding to non-DOM element ‘event’ bindings. Assume for a second that you have a simple JavaScript object like this: var item = { sku: "wwhelp" , foo: function() { alert('orginal foo function'); } }; and you want to be notified when the foo function is called. You can use jQuery to bind the handler like this: $(item).bind("foo", function () { alert('foo Hook called'); } ); Binding alone won’t actually cause the handler to be triggered so when you call: item.foo(); you only get the ‘original’ message. In order to fire both the original handler and the bound event hook you have to use the .trigger() function: $(item).trigger("foo"); Now if you do the following complete sequence: var item = { sku: "wwhelp" , foo: function() { alert('orginal foo function'); } }; $(item).bind("foo", function () { alert('foo hook called'); } ); $(item).trigger("foo"); You’ll see the ‘hook’ message first followed by the ‘original’ message fired in succession. In other words, using this mechanism you can hook standard object functions and chain events to them in a way similar to the way you can do with DOM elements. The main difference is that the ‘event’ has to be explicitly triggered in order for this to happen rather than just calling the method directly. .trigger() relies on some internal logic that checks for event bindings on the object (attached via an expando property) which .trigger() searches for in its bound event list. Once the ‘event’ is found it’s called prior to execution of the original function. This is pretty useful as it allows you to create standard JavaScript objects that can act as event handlers and are effectively hookable without having to explicitly override event definitions with JavaScript function handlers. You get all the benefits of jQuery’s event methods including the ability to hook up multiple events to the same handler function and the ability to uniquely identify each specific event instance with post fix string names (ie. .bind("MyEvent.MyName") and .unbind("MyEvent.MyName") to bind MyEvent). Watch out for an .unbind() Bug Note that there appears to be a bug with .unbind() in jQuery that doesn’t reliably unbind an event and results in a elem.removeEventListener is not a function error. The following code demonstrates: var item = { sku: "wwhelp", foo: function () { alert('orginal foo function'); } }; $(item).bind("foo.first", function () { alert('foo hook called'); }); $(item).bind("foo.second", function () { alert('foo hook2 called'); }); $(item).trigger("foo"); setTimeout(function () { $(item).unbind("foo"); // $(item).unbind("foo.first"); // $(item).unbind("foo.second"); $(item).trigger("foo"); }, 3000); The setTimeout call delays the unbinding and is supposed to remove the event binding on the foo function. It fails both with the foo only value (both if assigned only as “foo” or “foo.first/second” as well as when removing both of the postfixed event handlers explicitly. Oddly the following that removes only one of the two handlers works: setTimeout(function () { //$(item).unbind("foo"); $(item).unbind("foo.first"); // $(item).unbind("foo.second"); $(item).trigger("foo"); }, 3000); this actually works which is weird as the code in unbind tries to unbind using a DOM method that doesn’t exist. <shrug> A partial workaround for unbinding all ‘foo’ events is the following: setTimeout(function () { $.event.special.foo = { teardown: function () { alert('teardown'); return true; } }; $(item).unbind("foo"); $(item).trigger("foo"); }, 3000); which is a bit cryptic to say the least but it seems to work more reliably. I can’t take credit for any of this – thanks to Dave Reed and Damien Edwards who pointed out some of these behaviors. I didn’t find any good descriptions of the process so thought it’d be good to write it down here. Hope some of you find this helpful.© Rick Strahl, West Wind Technologies, 2005-2010Posted in jQuery  

    Read the article

  • Unbinding inline onClick not working in jQuery?

    - by Polaris878
    Okay so, I'm wondering how to unbind an inline onclick event in jQuery. You'd think .unbind() would work, however it doesn't. To test this for yourself, play around with the following HTML and JavaScript: function UnbindTest() { $("#unbindTest").unbind('click'); } function BindTest() { $("#unbindTest").bind('click', function() { alert("bound!"); }); } <button type="button" onclick="javascript:UnbindTest();">Unbind Test</button> <button type="button" onclick="javascript:BindTest();">Bind Test</button> <button type="button" onclick="javascript:alert('unbind me!');" id="unbindTest">Unbind Button</button> As you can see, unbinding does not unbind the inline onclick event... however it does unbind the click event added with bind(). So, I'm wondering if there is a way to unbind inline onclick events short of doing the following: $("#unbindTest").get(0).onclick = ""; Thanks

    Read the article

  • click events issue in jquery.

    - by alex
    I don't know if the title explain this situation well. Below is a code i wrote to create div elements when the button is pressed. Then By clicking on any of the created divs, we can change the div background by choosing a color from the drop down box. However if i click on another div and tried to change the color by selecting another color from the drop down, the previously clicked divs also gets affected by the new color. Why is this happening. I only want the selected div to change color, without affecting the previously clicked divs. I read allot of threads on this site, some of which talks about unbinding clicks, but I'm unable to solve the problem. Thanks for the help. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script> <style> .aaa { width:100px; height:100px;background-color:#ccc;margin-bottom:5px;} p{widht:500px; height:500px; margin:0px; padding:0px;border:2px solid red;color:#000;} </style> <select id="item_select" name="item"> <option value="1">red</option> <option value="2">blue</option> <option value="3">green</option> </select> <button>Click to create divs</button> <p id="ptest"></p> <script type="text/javascript"> var dividcount = 1; $("button").click(run); function run(){ var myDiv = $('<div id=lar'+dividcount+' class=aaa></div>'); $(myDiv).clone().appendTo('#ptest'); $(dividcount++); $("div").bind('click',(function() { var box = $("div").index(this); var idd = (this.id); $("#"+idd).text("div #"+idd); $("select").change(function(){ var str= $("select option:selected").text(); $("#"+idd).css("background-color",str); }); })); }; </script>

    Read the article

  • Does the jQuery .unbind() method only work on jQuery created events?

    - by Roberto Sebestyen
    I am trying to unbind all event handlers for all elements that are inside a particular container. Like a DIV. But those events have been bound/registered not using jQuery. Some are bound the manual way with onclick="...." or using regular native JavaScript. But when i do something like this $('#TheDivContainer').find('div,td,tr,tbody,table').unbind(); It does not appear to work. Which leads me to believe that the .unbind() only works if the events have been originally bound by jQuery. Is that true? Is there another way of unbinding all events from a group of elements ? Thanks!

    Read the article

  • Unbind Events with JQuery: Does it work with events setup in HTML?

    - by Abs
    Hello all, I have a few onclick and on mouseover events in my html generated by PHP, something like this: <div onmouseover="fave('heart_<?php echo $row['id']; ?>';" class="heart"><a href=""></a></div> I wish to make use of unbind on the mouseover but it hasn't worked when I tried this: $('#'+ id).unbind('mouseover'); So I am guessing unbind will only work with events created by JQuery? Is there something else I can try? Btw, I can't move my events to a separate js file as each id is unique and. Thanks all

    Read the article

  • How can I unbind a UDP port that has no entry in lsof?

    - by Chocohound
    On my Mac, I have a UDP port that is "already in use", but doesn't have an associated process: sudo netstat -na | grep "udp.*\.500\>" shows udp4 0 0 192.168.50.181.500 *.* udp4 0 0 192.168.29.166.500 *.* sudo lsof doesn't show a process on port 500 (ie sudo lsof -i:500 -P reports nothing). Note I'm using 'sudo' on both commands so it should show all processes. (rebooting works, but looking for something less disruptive) How can I unbind port 500 so I can use it again?

    Read the article

  • How do I unbind another jQuery function on .click()?

    - by Mike Barwick
    I have this script that run to fix my menu bar to the browser on scroll. Nothing really needs to change here (works as it should). However, you may need it... var div = $('#wizMenuWrap'); var editor = $('#main_wrapper'); var start = $(div).offset().top; $(function fixedPackage(){ $.event.add(window, "scroll", function() { var p = $(window).scrollTop(); $(div).css('position',((p)>start) ? 'fixed' : 'static'); $(div).css('top',((p)>start) ? '0px' : ''); //Adds TOP margin to #main_wrapper (required) $(editor).css('position',((p)>start) ? 'relative' : 'static'); $(editor).css('top',((p)>start) ? '88px' : ''); }); }); Now for the issue at hand. I have another script function that calls a modal pop-up (which again works as it should). However, it's not slick from a UI perspective when I scroll the page when the modals open. So I want to disable the script above when the modal script below is called. In other words, when I click to open the modal pop-up, the script above shouldn't work. $(function () { var setUp = $('.setupButton'); // SHOWS SPECIFIED VIEW $(setUp).click(function () { $('#setupPanel').modal('show'); //PREVENTS PACKAGE SELECT FIXED POSITION ON SCROLL $(setUp).unbind('click',fixedPackage); }); }) As you can see above, I tried to unbind the scroll function (the first code snippet), but this is not correct. These two scripts are in two separate js libraries.

    Read the article

  • How can I unbind JQZOOM in my JQuery Script?

    - by Andy Barlow
    Hello, I have this script at the moment, which changes an image when a thumbnail has been changed. I then want JQZOOM to be added to that new image. However, if I put it inside the Onclick event, it gets slower and slower the more times you click on it... I guess because its running multiple instances. Is there anyway to unbind the JQZOOM from something then rebind it to something else? Here is my jquery at the moment: var options = { zoomWidth: 400, zoomHeight: 325, xOffset: 25, yOffset: 0, position: "right", lens: true, zoomType: "reverse", imageOpacity: 0.5, showEffect: "fadein", hideEffect: "fadeout", fadeinSpeed: "medium", title: false }; $('.jqzoom').jqzoom(options); $('.single-zoom-image').click ( function () { $('#bigProductImage').attr("src", $(this).attr("zoom")); $('.jqzoom').attr("href", $(this).attr("extrazoom")); }); Thanks in advance if anyone can help me. Cheers!

    Read the article

  • jQuery Ajax loads URL multiple times, how do I unbind/rebind properly?

    - by gmoz22
    I load a SELECT element via Ajax (list of brands), get its selected value (brand id) and load another SELECT via another Ajax URL (list of templates for currently selected brand). Here's my code: $(document).ready( function() { // DO NOT cache Ajax calls $.ajaxSetup ({ cache: false }); // loader var ajax_load = "Loading..."; // Brands List URL var loadBrandUrl = "getBrandsList.php"; // Templates List URL var loadTemplateUrl = "getTemplatesList.php"; $("#brandslistSelect").html(ajax_load).load(loadBrandUrl) .ajaxComplete(function(){ // Brands select loaded /* Load Templates SELECT the first time since no .change() has happened */ var selectedBrand = $("#brandslistSelect option:selected").attr("value"); // get the value console.log(selectedBrand); // Log selected brand to console // get Templates select, commented for now since it does an infinite loop // $("#templateslistSelect").html(ajax_load).load(loadTemplateUrl, { BrandId: selectedBrand } ); /* End initial load template */ /* On interaction with the Brands SELECT */ $("#brandslistSelect").change(function () { // on interaction with select selectedBrand = $("#brandslistSelect option:selected").attr("value"); // get the value // get Templates SELECT $("#templateslistSelect").html(ajax_load).load(loadTemplateUrl, { BrandId: selectedBrand } ) }); /* End interaction with the Brands SELECT */ }); }); It returns selectedBrand in the console 3 times : selectedBrand = undefined selectedBrand = undefined selectedBrand = 101 Now, if I uncomment the following line, same output as above but it also loads the templates URL indefinitely : // $("#templateslistSelect").html(ajax_load).load(loadTemplateUrl, { BrandId: selectedBrand } ); Any idea how I could modify this code to make it work as intended? Thanks for your help stackOverflow community!

    Read the article

  • OpenGL Application displays only 1 frame

    - by Avi
    EDIT: I have verified that the problem is not the VBO class or the vertex array class, but rather something else. I have a problem where my vertex buffer class works the first time its called, but displays nothing any other time its called. I don't know why this is, and it's also the same in my vertex array class. I'm calling the functions in this order to set up the buffers: enable client states bind buffers set buffer / array data unbind buffers disable client states Then in the draw function, that's called every frame: enable client states bind buffers set pointers unbind buffers bind index buffer draw elements unbind index buffer disable client states Is there something wrong with the order in which I'm calling the functions, or is it a more specific code error? EDIT: here's some of the code Code for setting pointers: //element is the vertex attribute being drawn (e.g. normals, colors, etc.) static void makeElementPointer(VertexBufferElements::VBOElement element, Shader *shade, void *elementLocation) { //elementLocation is BUFFER_OFFSET(n) if a buffer is bound switch (element) { .... glVertexPointer(3, GL_FLOAT, 0, elementLocation); //changes based on element .... //but I'm only dealing with } //vertices for now } And that's basically all the code that isn't just a straight OpenGL function call.

    Read the article

  • FancyBox Callback Keydown

    - by headShrinker
    I have been working on this code, and I can't seem to figure it out. Fancybox's callbacks don't seem to work at all. I have the keyboard bound to the pagination for this gallery. But I want to unbind the keyboard from the table when fancybox opens. When fancybox opens nothing changes.... What to do?? $(document).ready(function() { $('a.active').click(function() { var url = $(this).attr('href'); $('#ajaxTable').load(url+'/1'); return false; }); $("a.fancy").fancybox({ callbackOnStart: function() { $('a#gleft a#gright').unbind("keydown"); }, 'frameWidth': 570, 'frameHeight': 470 }) $(document).keydown(function(event) { if(event.keyCode == 37 ) { var url = $('a#gleft').attr('href'); if (url != null) { $('#ajaxTable').load(url+'/1'); $(document).unbind("keydown"); } } else if(event.keyCode == 39 ) { var url = $('a#gright').attr('href'); if (url != null) { $('#ajaxTable').load(url+'/1'); $(document).unbind("keydown"); } } }); });

    Read the article

1 2 3 4 5 6 7 8  | Next Page >