JQuery :: Using .live() With .each()
Jul 22, 2010
I have a function that I apply to every anchor tag in a div called listnav. I do so like this:
$('.listnav a').each(function(i, el) {
$(el).click(function(ev) {
ev.preventDefault();
var href = $(this).attr('href');
[Code]....
This,among other things, causes a function called load to be called on the href of the anchor. This works fine. Howver I want to use the live() function with this as I am going to dynamically change the links in the listnav div. I tried doing it like this :
$('.listnav a').each(function(i, el) {
$(el).live('click',function(ev) {
ev.preventDefault();
[Code]....
But that does not work. My question is how would I go about changing this function so that the actions are applied to any new anchors added to the div dynamically?
View 2 Replies
ADVERTISEMENT
Jan 10, 2012
I am exhausted today, not to include the funk that the BCS national championship put me in, so I must be either crazy or missing something. When I do the following the code works;
[Code]...
View 3 Replies
View Related
Oct 4, 2010
how to toggle between functions, however I because I am reloading the element that contains the checkbox I am clicking, I need to use the live function (I think).
I have used live before and it works great for clicks, but can I use it with toggle.
View 1 Replies
View Related
Oct 14, 2010
frist of all, im a newbe on jquery. i have a table where i can add new "<span>" and i can edit it with editInPlace plugin but i have a problem. when i load the web with those elements (<span>), i cant edit it after i add a new item, then, all the items are editable
[Code]...
View 1 Replies
View Related
Aug 8, 2011
how I can execute this 'function(dateStr, inst)' . The jQuery partially works it divert to another page but without parameters, the outcome displays [object Object].
Code:
$.noConflict();
jQuery(function() {
jQuery('#datepicker').datepicker({
[Code]....
View 1 Replies
View Related
Jan 31, 2011
I am using a delayedObserver which works great, but I can't figure out how to use it when the field I am binding is loaded via ajax. So ideally, something like this:
$('[data-live_form_field]').live
.delayedObserver(0.35, function(value, element){
$(this).parents('form:first').submit();
});
This would bind any form elements with the live_form_field data attribute to the observer and submit the form. The code doesn't work though since that isn't the right syntax for the .live method.
View 1 Replies
View Related
Jun 18, 2009
So I have a set of <SELECT> elements that are ajax'd in and out depending on what is selected using the event "change". I know that .live("change") is not fully supported.
View 2 Replies
View Related
May 18, 2009
I normally do this with livequery:
So any new .mylink's on a page would also be bound with my custom function.
How can I do this with the new LIVE event? or is it even possible?
View 4 Replies
View Related
Sep 1, 2009
This is my Html: I am trying to get the element that I binded to live(), but always i am getting it's children. For example, this is my code:
<div id=div1 class=theClass><b>Hye</b></div>
<div id=div2 class=theClass>Hello
</div>
[Code].....
View 1 Replies
View Related
Jan 6, 2011
I am trying to:
$('.entity_id').live(
'mouseover mouseout' , function(event){
if (event.type == 'mouseover') {
console.log('mouseIn entityID', $(this).attr('client'))
$(this).css('color: red;')
} else {
[Code]...
this is supposed to work whenever:
[Code]...
is in the dialog box, the logs are working, but the css color changes are not.
View 2 Replies
View Related
Jan 19, 2010
I have this in my jQuery() function:
$( "#admin_new_records ul a" ).live( "tap", function() {
jQT.goTo( "#admin_new_records" );
return false;
});
I create the links that match this on the fly with jquery.builder.js, and have confirmed that searching the resultant DOM in the console with the string "#admin_new_records ul a" does indeed return the elements I want. The problem is that when I click on the links, the jqt framework still seems to handle the tap, and returns to the first screen with an error due to the fact that it cannot recognise the url I created for the links. The issue seems to be that live does not work, but I have also tried to set this on tap() immediately after creating and appending the links, and this does not work, either.
View 2 Replies
View Related
Mar 10, 2011
I'm working with the quasipartikel plugin for multi selection. Available here:Mutliselect.Great plugin, very happy with it overall.However, on my page I want to trigger functionality when something is added or removed. Looking through the code, I see that a link is added for each item of a selection box with the class 'action'. Thus, I figure I should be able to trigger code of it, like so:
var j$ = jQuery.noConflict(); j$(document).ready(function() { ...
j$('.multiselect').multiselect();
...
[code]....
View 1 Replies
View Related
Feb 19, 2011
I am trying to use the .live() jQuery function in cooperation with the .addClass() function, but I am unsure of how exactly to pass the parameter of the class-to-be-added's name through the live() function to work with addClass().Here is an example of the jQuery I would be using: [code]
I would like to use addClass() in both instances in the code above in cooperation with live() while being able to pass the class's name through the live() function. I've searched around the web quite a bit, but none of my searches have resulted in an answer that fits my specific needs.
View 2 Replies
View Related
Apr 20, 2011
my jquery was intially was
$(document).ready(function () {
$('ul.nav li').hover(
function () {
[code]....
View 4 Replies
View Related
Jan 15, 2011
I have my own custom function:
function callFunction(param1, param2) {
}
this function is called when a user clicks on an image
onClick='callFunction(1,2);'
etc.
How do I apply live to callFunction? The image appears from an ajax call and as such the function doesn't recognise the call. I've used live on my other simple functions, but how would I use it on my custom function? The reason I am using the custom function is because I need to pass parameters to it.
View 1 Replies
View Related
Dec 10, 2010
Automatically submit a form using .live()?
View 6 Replies
View Related
Mar 5, 2010
This code is supposed to find all table rows with a class of "selected", remove that class, then find all checked inputs that are descendants of a tr and give its tr a class of selected. The problem is, that even radio boxes that are not checked are being returned by $(' tr input:checked', '#deviceSelection') and everything is getting a class of selected. Anyone know whats wrong? I'm using jQuery 1.4.1
[Code]..
View 2 Replies
View Related
May 17, 2011
I am trying to bind the live event to the fadeTo(). I am doing so because after the page is loaded, I am adding new elements to the page through ajax and need them to come in as faded. This is what I currently have.
$('.work').fadeTo('fast',.35);
This is what I have tried to do.
$('.work').live(fadeTo('fast',.35));
Above does not seem correct, but I have searched for more info/documentation on using live() with fadeTo but have found nothing.
View 4 Replies
View Related
Apr 6, 2011
I have some ajax functionality I have made, this basically creates an item in a database by an add button, the items are in a li.
I have a delete button span which when pressed shows a confirm or cancel buttons which are hidden initially, If i have more than one item in the list is will show and hide them on all the items in the list, heres the code
$('.source_delete').live('click', function(){
//Fade out delete button
$('.source_delete').fadeOut();
//Show confirm button
[Code]....
I need the show and hide not to apply to all items in list, the issue is im aware you cannot use live and each together, is this correct?? how can I go about doing this?
View 4 Replies
View Related
Jan 15, 2010
I am new to jQuery. My background is C++ and C#. Once I have the html using selectors and filters is not hard to understand. My problem is understanding how to capture a live html page in jQuery and assign the page to an object which I can then use to extract information using basic selector and filter functions.
View 1 Replies
View Related
May 24, 2011
I have an idea for a website I'm about to design and develop and would like some help before voicing this to the client.
The site will be quite sober, technology and science portfolio of a company.So, most of it is just text.
There would be a portfolio menu page, with a few categories (science / technology / web )
Now, instead of having a drop down menu..
I thought it might be a nice idea to have a pie graphIMAGE(well maybe a bit nicer looking)where each color represents the category. Based on the number of projects belonging in that category, the graph would change to show that. is this possible with jquery?
View 1 Replies
View Related
May 11, 2010
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].....
View 1 Replies
View Related
Jan 19, 2010
I am in the process of porting an application i have been building for a couple of years to jQuery from jquery/prototypejs&scriptaculous.
Reading the new documentation i see that bind can take multiple observers (for example)
$(
"div.test"
)
.bind
(
[Code].....
Is this also true with "live" ( i am adding alot of dynamic elements to a page that have tooltips attached to them and have written a simple tooltip plugin that uses live to stop me constantly needing to call the plugin everytime somehting on the page changes to do with the tooltip..
View 2 Replies
View Related
Feb 15, 2011
i am using jquery cycle plugin togther with livequery. It is working fine except pagerAnchorBuilder. Any body know how to fix this problem. Jquery Cycle Code is following:
$j
(
'ul.slider-thumbs'
).
livequery
(
function
[Code]...
View 3 Replies
View Related
Mar 21, 2011
I am very new to jquery live function & i stuck in to the problem. I am using live function to get the ajax response & appending to the div here is my code,
function add_master(module_url, response_target_id, custom_id) {
$('a.addclass').live('click', function() {alert('add');
$(response_target_id).fadeIn('fast');
[code]....
View 4 Replies
View Related
Sep 15, 2011
Is JQuery live() supported in mobile app browsers? I am having a difficult time getting an application to work. I've posted some code to illustrate/test the problem below. Three lists, #1 using bind(), #2 using live(), and #3 using live() whilst allowing to add list elements. Clicking the list item should just bring you to a second page that displays your selection (it updates whatever was there before, original text is 'original' text). Works great on my PC in all browsers except IE, and on Android/FireFox, but not with IPhone/Safari and Andrpid/WebKit: ot only is the event not triggered on dynamically added list elements, it's not triggered on the 'static' elements in lists #2 and #3. The app was written using JQTouch; wondering if that disrupts somehow JQuery functions.
Ozone2.html
<html>
<head>
<title>Ozone 2</title>
[Code]....
View 1 Replies
View Related