JQuery :: .live() Fires Multiple Times?
Oct 18, 2011
I have a problem when I use the .live() function that I can't figure out. It's something I've run across several times and it keeps confusing me.
My jQuery:
jQuery('#content div.portfolio').live({
mouseover: function(){
jQuery(this).find('img').fadeOut();
[code]....
My problem is: when the mouse enters and leaves the image the image fades in and out for up to four times. The first mouseenter is just fadeout, fadein, fadeout. why is the event being triggered multiple times and more importantly what can I do to prevent this behavior?
View 8 Replies
ADVERTISEMENT
Feb 1, 2010
I am using JQuery 1.4.1. I have HTML input elements which created dynamically. I have assigned "focusin" event all input elements. While loading page, it is triggers only once while focusing each input element. When I minimize and maximize the page, focus event is fired multiple times. Finally it show "Stack overflow at line 0".
$('input').live("focusin",function(objectRef) {
alert("focusin event");
})
View 1 Replies
View Related
Apr 30, 2009
I add multiple items with each click and then I want to remove them one by one by clicking. All is ok, but if I add 2-3 items and the click the first one, confirmation alert fires multiple times when i click Cancel. The number of times depends on how many items goes after curent.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/
TR/html4/strict.dtd">
<html>
[code]....
View 7 Replies
View Related
Sep 1, 2010
I have a series of 6 checkboxes with the same name. The purpose is that whenever one of these is checked or unchecked, another part of the page is filled again based on an AJAX query, that has the values of all the checked checkboxes as input.
I added an onchange event handler like this: $('[name!=stage]').change(refillActionsParameters); what happens is that this handler function gets called 6 times when I check or uncheck any of the checkboxes. As a remedy, I put the onchange handler on the form that contains the checkboxes, but that didn't help, still 6 times.
Also: is there a quick way to retrieve the values or the ids of the checked boxes?
View 4 Replies
View Related
May 25, 2006
This is my first post to this forum. When a button in parent window is clicked multiple times, more than one popup window is opened. This problem is occurring in linux firefox and mozilla browsers. In windows the code is working fine. Is there any option in window.open() method to open a popup window once. s there any known issue regarding this case?. Need a workaround to fix this issue.
View 1 Replies
View Related
May 24, 2006
hen a button in parent window is clicked multiple times, more than one child window is opened. This problem is occurring in linux. In windows the code is working fine. Is there any option in window.open() method to open a child window once.
View 8 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 11, 2011
I need some help achieving an effect.
<span>SOME TEXT</span>
First part, move "SOME TEXT" left 20px and fade to 0 at the same time. Easy enough.Second part, repeat the same effect half way through the first part is done and the starting point is left 20px.So I would need to create the first effect. Half way through the first effect the second effect starts but it has a different starting point.
View 1 Replies
View Related
Sep 26, 2010
Iīm using Autocomplete - jQuery plugin 1.0.2 .. I know has been upgraded to another plugging but i want to continue using the old one.
I have on issue that I would like to get rid of it but I donīt know how. The problem is that when a term is searched, the autocomplete list suggest the same term multiple times, as many times as there are products with the same name, lets say the same text "cold beer". I just want that autocomplete suggest the term one time.
View 8 Replies
View Related
Sep 14, 2011
I copy pasted some code that hides list headings on sharepoint2007 web page.As im new to jQuery I just made 3 copies of the script.But I suspect there is a beter way to code this?Maybe put all scripts in one block. Or maybe it realy does not mater?
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript"> $(document).ready(function(){ $("table[summary='abc'] tr:eq(0)").hide() }); </script>
<script type="text/javascript"> $(document).ready(function(){ $("table[summary='xyz'] tr:eq(0)").hide() }); </script>
<script type="text/javascript"> $(document).ready(function(){ $("table[summary='123'] tr:eq(0)").hide() }); </script>
View 2 Replies
View Related
Nov 30, 2009
I have a form with a jquery listener that runs when you click the submit button. If there are errors an alert box will pop up telling you what they are. sometimes this box will pop up multiple times because the form is being re-submitted without clicking the submit button.
live demo: [url]
HTML
JS
PHP
View 1 Replies
View Related
Mar 1, 2010
Following code works.
$('#container a').bind('click', function(e){
log( $(this).text() + ' clicked1');
return false;
});
[Code].....
View 2 Replies
View Related
Nov 10, 2011
My goal: I'm trying to to create a configuration dialog and persist it so the user can edit it later. Since the configuration is long and has Datepickers, Sliders, different types of inputs and such, I'm loading a new page for the configuration and using ID to get values from them. For example, the page has a datepicker text input "startDate" and a datepicker for it.My problem:1) I load theconfigurationpage into a div of home page make a dialog out of it. jQeury moves that div to it's own div that it created in the body of home page. So when I add multiple dialogs, datepicker doesn't work anymore since there are two "#starDate" input fields in the page now. I also plenty of other cases where I use the ID directly to do other tasks. Is there a way for me to go forward with this.
View 1 Replies
View Related
Dec 19, 2010
If this search function is included in an include file with other functions it will run more than once if you click another function first, then come back to it to do another search.
Code:
$(document).ready(function() {
$("a#searchowner").click(function() {
var searchval=$("#p1").val();
alert(searchval); //test alert box
$.post("findowner.php", {p1 : searchval}, function(data){
if (data.length>0){
$("#ownerIDdiv2").html(data);
}});
});
}); //end
For example if I click the next page function, then decide to click for a new search it runs more than once:
Next page function:
Code:
$(document).ready(function() {
$('a#nextpage').click(function() {
var page = $(this).attr('page');
var searchval = $(this).attr('schval');
var maxpage = $(this).attr('maxpage');
$.post("findowner.php", {
p1 : searchval,
page : page
}, function(data){
if (data.length>0){
$("#ownerIDdiv2").html(data);
} });
});
}); //end
However, if I put the first search function in a separate include file all works perfect. Why it runs multiple times if it is grouped among other functions?
View 14 Replies
View Related
Jan 20, 2011
We know that multiple calls to $(document).ready(); in the same page is possible.
I have a situation where another team implemented a $('#element').live('click', function() { /* Do this */} ); call on #element. I cannot modify this code, but I need to take an additional action on the same element on the same event. So, two actions will occur when #element is clicked.
I tried making $('#element').live('click', function() { /* Do that */} ); but this call does not fire.
It needs to be .live() since #element is being dynamically added.
Is there any way to add more actions to the same event on #element?
View 8 Replies
View Related
Jul 7, 2009
New to jQuery and Validation so please go easy :) The issue: If I validate more than one field with 'phoneUS: true' it breaks jQ Validation and no longer validates anything at all.
[Code]...
View 1 Replies
View Related
Sep 1, 2009
I have a hidden popup that I populate with content and it dynamically expands to the size of the content. I then show the popup. When a user clicks on another link, it populates the popup with longer or shorter content. When the content is SHORTER, it seems to show the background image that I'm using expanding to the height of the previous size of the popup. I've tried setting the height manually with JS, no luck. This only happens on IE6.
View 1 Replies
View Related
Apr 15, 2009
I'm currently working on a browser based 2d multiplayer rpg using PHP and ajax. As the number of beta testers has increased, I have found that there is a significant amount of lag involved in changing maps (maps are 480x480px ea consisting of multiple images. What I would *like* to do, ideally, is only load each image once. So the first time I encounter "grass1.png", for example, it is loaded into div id "grass1", and never needs to be loaded again. My question is this, is it possible, to do the above, and then call div id "grass1" for each instance of the image?
This way, I could store all images encountered thus far. When the player left a map, all images would be positioned off-screen, and moved into the field of view as needed. I am already doing this, but there is a div for each unique object. (meaning there could be 10+ divs for the same image, for just one single map!). This would be much more efficient if I were able to call and store just one div per image, and just display it multiple times in multiple places.
View 2 Replies
View Related
May 20, 2011
I made a sort of typewriter script that shows every next character of a text in a particular DIV, each milisecond. (testing in IE, not tested in other browsers yet)
Now, after the function has run, I cannot run it again. It stops all completely.
I have put some variable in it to see it's running or not. But that doesn't help it anyway.
Has this something to do with event bubbling or something else?
Code JavaScript:
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<title>Test</title>
[Code].....
View 3 Replies
View Related
Jul 21, 2011
We have a webpage setup to alpha page individual people with pagers at work. It is a simple form that submits to a php file on the pager server. I am working on creating a script that submits a alpha-page to everyone at once. There are about 120 different ppl in the company, I want the script to submit the form once for each persons pager. I'm new to javascript but have alittle programming understanding.
[Code]....
View 2 Replies
View Related
Nov 10, 2007
I got a very good select script that produces multiple values and it works fine by itself but I have two other instances of the same script on the same page. I know that multiple scripts don't work on the same page unless you execute the onChange for all three. But I dont have a clue how to do that. Code:
View 9 Replies
View Related
Jul 23, 2009
I must be having a brain cramp, but I having a problem that is so very simple ... but can get my head around it.
[Code]...
View 3 Replies
View Related
Apr 13, 2010
I'm currently working on my first ever javascript and have run into an issue.
Source:
Code:
<script language="JavaScript">
img_width = 0;
img_height = 10;
timer = null;
function imageGrow(bar_len) {
growImg = document.getElementById('imageResize').style
growImg.width= img_width;
if(img_width != bar_len) {
img_width += 10;
timer = setTimeout('imageGrow()', 20);
} else {
clearTimeout('timer');
}}
</script>
<img onLoad="imageGrow(100);" src="img/graph.jpg" border="0" width="1" height="10" id="imageResize" align="center"><br />
<img onLoad="imageGrow(50);" src="img/graph.jpg" border="0" width="1" height="10" id="imageResize" align="center"><br />
I have 2 issues. First, the second image does not call the javascript and I assume this is because both images have the same ID? Can I associate code to 2 elements? Is it even possible to call the function multiple times in the way I'm trying to? Second, as the script is written above, the image never stops growing even when it reaches '100' as specified in the script. If I change 'if(img_width != bar_len)' to if(img_width != 100) it does stop growning when it reaches 100. I am unsure why, as bar_len = 100 when I call the function! I don't know if it makes any difference, but the HTML in my final code will be dynamically generated with ASP.
View 7 Replies
View Related
Jul 23, 2005
I have a javascript that displays couple of buttons, which are
directional (e.g., click button it goes to a particular page). I need
to have these buttons shows up multiple times in same page, each
represent a different direction but buttons themself are from the same
gif file. What's the most effecient way to do this?
View 1 Replies
View Related
Sep 3, 2011
First off I didn't know whether to post this here or in the PHP section since it deals with both, but mostly JS. I have a PHP scraper that scrapes the job title, company name and location from a website and stores them in separate arrays. These values are then extracted out one at a time from the array and stored into a string, that is then passed to a Google Maps API.
I can make this successfully happen once, the thing is I need to do it multiple times. I have an idea on what I should do but don't really know how to implement it (correctly). The idea I had was to create a function in the JavaScript section that accepts three values from PHP. This function would be called in my PHP for loop that extracts the values from the array into a string. The thing that confuses me is that the Map function is called via <body onLoad="initialize()">. Here's the link to my code (http://pastebin.com/rTfzJM16)
View 1 Replies
View Related
Dec 7, 2011
I'm messing a lot with the issue but it is driving me nuts Issue is, I'm applying Nivo Slider on 3 instances. It works fine on 2 but not 3rd. If I apply the Nivo Slider on 2 instances then it works fine for 1 but not for 2nd. So Strange.
View 1 Replies
View Related