I have a DOM element that is generated with js, and therefore when i want to bind a click event listener i need to use $(generatedEl).live("click", fn...) (is there a different way?)
here is the code i am using:
$(".toggleView").live("click", function(){
if(isTrunced){
$(this).htm...
Element.implement({
addLiveEvent: function(event, selector, fn){
this.addEvent(event, function(e){
var t = $(e.target);
if (!t.match(selector)) return false;
fn.apply(t, [e]);
}.bindWithEvent(this, selector, fn));
}
});
$(document.body).addLiveEvent('click', 'a', function(...
Not sure what I'm doing wrong with .live()
$(function(){
var wrapper = $('#trailer_wrapper');
var button = $('h2 a');
button.click(function() {
wrapper.fadeIn(2000);
button.addClass('selected');
button.text('close ×');
return false;
});
$('h2 a.se...
Hi there.
Here is the code in question:
$(".navItems>ul>li").live('click', function() {
var selectorID = $(this).attr('id');
$(".infoList").slideUp('fast', function(){
switchTabInfo(selectorID);
});
function switchTabInfo(selectorID){
var actionID = selectorID.substring(4);
actionID = "#" + actionID;
$(actionID)...
So today I just came across the 'live()' function that binds any future and past elements to the whatever event you choose, such as 'onclick'.
Right now I'm having to set up buttons like the following each time I load a new button via ajax ...
$('a.btn.plus').button({icons:{primary:'ui-icon-plusthick'}});
$('a.btn.pencil').button({icon...
I have a form wizard. On step one I need to display a warning if a certain checkbox is checked and others with a certain class aren't . The problem is that it displays the confirm/warning on the second step after hitting the next button. I need it to prevent the browser from moving to the second step while displaying the warning.
$("#s...
My problem is that I am not sure how to use .delegate for the following scenario:
our application has a voting system to which several rounds or steps can be added. every time a new step is added there is a list of options that defines how the round/step is to be won.
<select class="listOfOptions">
<option value="U">Unanimous</option...
I am using jquery as so
$('.mybutton').live('click', function(){
// do something
});
this is called when the document is ready but when the document is ready there are 'mybutton' classes being used, but if the user clicks somewhere a new form appears which uses the button with the class 'mybutton'. But this does not seem to be wor...
when my ajaxupload script finishes it adds a read-only input w/ the value of the image's URL.
it is a long script, but i think this is the relevant part that fires on successful completion:
var location = '<div id="'+ID+'_location" class="img_location">' + '<input name="'+ID+'" class="location regular-text" type="text" size="50" read...
Hi, I'm having a problem getting content loaded into a document to fire jQuery scripts.
I have the following code
$(".jquery-selectbox").change(function(e) {
url = this.options[this.selectedIndex].value;
$('#pane2').fadeOut(500, function () {
$('#pane2').fadeIn(500);
...
Hi guys, I'm trying to remove a row from a table when I click a specific row column. I'm using .live() so that I can remove rows added from a ajax request. It works fine, my problem is, the table comes from php with two rows, I can then insert new ones and remove them, but when I remove one of the rows that came with php, it remove all r...
I've got a dirty text variable I need to set on a text change, radio button change or dropdownlist change in a form. Unfortunately the generic:
$(':input').live('change',function(){... })
also detects a change in focus... thus making a false positive for dirty text.
...