JQuery :: Cannot Use Delegate For Scroll Events.
Jun 20, 2011If instead of "scroll" you choose any other event ("click", "mousenter", etc), the delgate works.Is not possible to delegate scroll events?
View 1 RepliesIf instead of "scroll" you choose any other event ("click", "mousenter", etc), the delgate works.Is not possible to delegate scroll events?
View 1 RepliesI tried to use delegate, but it is bounded with events. I don't really want to execute a function on a standard event. But I would need to change the elements that match a selector, when they appear in dom. Is possible to "unhook" delegate from events?like for all existing and new elements with class ".red" to add to the "data" a new key "initiated:true".
View 2 Replies View RelatedI'm trying to get a delegate() event to fire in IE (any version) with no joy. The code below works in Firefox, Safari and Chrome:
$('#gmap').delegate('a.removepoint','click', function(event){
alert('Remove');
return false; });
The link <a class="removepoint" href=""/> is created inside the infoWindow of a GoogleMap.
My understanding is that delegate() should find this, even though it's been created afterthe document.ready(), yet IE will not pick it up.
Here is what I have at [URL]...Basically I setup a function for message selection that will call an AJAX request. Once content is loaded via .html() in my #messages div, I could not click links from within and have to use .delegate().
The code works fine when I copy and paste code from my message_click function, but if I access the function from within .delegate(), it does not work. Is it possible to use a predefined function with .delegate() or will I have to continue to reuse code?
It turns out that jeditable.js will not work on any content that was .load(ed) Is there a way to use .delegate to accomplish the same as .load
View 3 Replies View RelatedI load a static page, inside this page there are links like this:
<a href="some/path/here/with/id" class="update">Click</a>
With this function I can change the link value (Click) with a second value depending on ajax response.
$('.update').click(function(event) {
event.preventDefault();
$.post('script.php', {}, function(data){
[code].....
Why this submit event is not executing? It works fine if I change it to a "click" event and serialize the submit buttons parent form but I'd like to know why wont this work?
[code]
$(dialog).delegate("form#stayplanselect", "submit", function(event) {
event.preventDefault();
$.post("/admin/viewer/rates", $(this).serialize(), processResponse);
});
[/code]
I've used nice livequery plugin for many things, not just for binding events. Now when jquery1.4.2 is out it seems like it is time to replace $.livequery() with new .delegate() or even .live(), but browser events like (ready) does not work. Am I using the incorrect event (with delegate)? For example I am using livequery:
$('ul.fileList li').livequery(function(){
var oi =$(this);
// DOM manipulation, appending menus and attaching plugins and so on
[code].....
Demo at [URL]
Description: If you perform any selection, alert will be triggered. It fails in IE.
Code: [URL]
I'm using jQuery 1.4.4 andI can't understand where I'm doing wrong, I'm simply populating all the rows of a table with template function, so far so good, but I cant delegate the "hover" (and click and all the events) event on a row or a cell.
I've tried to put the .delegate() code also in the footer of my page but nothing.
My code actually is:
Plugin:[url]
Usage examples:[url]
I have a dropdown box and a div. Depending on what is selected in the dropdown box, different content is appended to the div using the jQuery append function. This is working without problems. But, when I append DOM that should trigger events, I am using the delegate method to accomplish this. That is also working without problems, but not with the tooltip plugin. Let me try to illustrate what I mean with some code.
jQuery
HTML
Using Firebug, the "inside delegate" is indeed printed in the console every time I hover over the text, but nothing happens with the tooltip. I have tried to insert the text directly into HTML without appending it with jQuery, removing the delegate and then it works perfectly. For some reason beyond my knowledge, I can not get the plugin to work when I append the text and use the delegate method to set the event.
I've an HTML table that uses the jQuery-datatables plug-in. One of the columns in the table includes a button for adding a new row to the table immediately following the row where the button was clicked from.
My HTML code is as follows :
<table id="contactInfo">
<thead>...</thead>
<tbody>
<tr>
<td>...</td>
[Code]....
With this code, the function() to execute my button's onclick event isn't loading and therefore I cant event see the "button clicked" alert msg.
Is there any way to use delegate function without any event or in document ready event? [code]
View 8 Replies View Relatedwhy the following code (which counts the remaining allowed chars in html-textarea) does not work in Firefox although it works in all other browsers, IE including?
[Code]...
I am trying to "ajaxify" my site. Now I have one problem:
$("#posts").children().remove();
$("#tag-sidebar").children().remove();
$.each(data.Tags_Sidebar, function (indexInArray, valueOfElement) {
var insert = $("<li>");
[Code]......
Now when I click one of those links (href1, href2, href3) generated, the click event won't execute! What's the problem? Also, is it right that I have to transfer the valueOfElement over, like I did? What does stopEventPropagation do? Prevent the href from being navigated to? That's what I am trying to do.
The data object is JSON fed from here:[URL]
The HTML is here: [URL]
I have a series of images with an animation bound to mouseover and mouseleave events, and I'm trying to get my head around adding a click event that would prevent the mouseleave animation from occurring only for the image that was clicked, preserving everything else as is (until another image is clicked). I've discovered .stop() and I think I'm getting close, but some part of the logic is still escaping me.
View 3 Replies View Relatedi'm using this code:
$("#mydiv tr:not(#tableheader)").delegate("td:not([enabled=false])", "click", function(){
alert($(this).html());
})
but it doesn't seem to work.
i have 1 div with scrollbars and another div with a table inside. when user scroll horizontal bar in div1 i want application to scroll the table header from the same amount of pixels and in the same direction. i did not find anything under jQuery about that.. :-(
1. how can i detect in which direction the scroll is done (to the right, or to the left) ?
2. how can i determine how many pixels this scrolling is about ?
3. how to scroll the table header (table tag or th tag) from the same amount of point ?
i found just scrollLeft for now and i'm not successful to use it
how to make an image/text to scroll as the user scroll the page also? for example if the user scrolls down image/text also scrolls down and when the user scrolls up image/text also scrolls up..
View 6 Replies View RelatedIs there a way in which we can disable the history scroll functionality in IE? Basically disable the SHIFT key + Mouse Scroll combination.
View 1 Replies View RelatedDoes anyone know of a script that makes a div tag and its contents scroll down the page automatically when you scroll?
View 2 Replies View RelatedI've got 2 pages: a current events page and a past events page the current events page loads fine as there is only about 10 events the past events page takes about 30 seconds to load and will crash if u click your mouse in the loading time.
The pages are near identical the only difference is the query that selects the events (> versus <)
The page loads immediately without:
But when i put it back in the above happens. I'm using jQuery.roundedcorners.
How can I make "change" or "delegate" work with a drop-down menu and dynamic content in IE (i.e. IE8)?
$("select.cat").live('change', function() {...
$("select").delegate(".cat","change",function() {...
Nothing seems to work with IE. Does anybody have a suggestion to address thisfrustratingmatter? What else could I try?
I continue to read "jQuery In Action" and one doubt came into my mind when I was reviewing the chapter 4 that talks about Event handlers.Within a particular code sample (bamboo.html), the author has written a ".change(fn...)" method with a function to handle the event that manipulates the changes made within an "input[type=text]" to reflex the price to pay against the amount of product the client selects , and, at the end of the same wrapped set, it's included a call to the "change()" method again (see the code below).My question is, when is it necessary to call the event handler (e.g. ".change()") more then one time within the same wrapped set?
$('span[price] input[type=text]').change(function(){
$('~ span:first',this).text( $(this).val() * $(this).parents("span[price]:first").attr('price') ); }).change();
Geeting a JS error from IE 6 only in this method: handle: function( event ) { var all, handlers, namespaces, namespace, events;
[Code]...
On the last line of the code snippet above. It appears to me that IE6 doesn't like the fact that the events object is undefined. To trigger this error we are doing a simple blur binding to an input box. ex:
$(field).bind('blur', function(){onfocusout(this);}); It appears IE 6 stops executing JS after the error (imagine that). Is this an issue in jQuery core or BTW I know MS has dropped IE 6 support but we still have customers.
I have a very simple html structure and the idea is to create and useDIVs or elements I do dynamically, so there is one div which I use todo something like:
$("#main").html("<div id='img-lisg'><img id='img1' .....></div>");
That works just fine, the problem is when I try to use events on theelements I've created dynamically, those just don't work. There issomething like this:
("#dynamicDiv").click(function(){
alert('Testing');
});
It never works,... how should I create the handlers for the DIVs