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?
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;
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.
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)
is there a way to find out if a Javascript function exisits on the page more than once? I know I can do window.FunctionName and return a boolean to find out if it exists or not, but I'm trying to check and see if I have multiple functions with the same name on the page.
I cannot call a function more than one time in my page, the function is:
Code: <script> function seeBig(_this) { document.all.view_img.src=_this.parentNode.getElementsByTagName("img")[0].src; }
[Code]....
what problem I am facing is, if I want to build another table as the same as the one above, the function will not work. I know I might need give the function an ID
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.
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?
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.
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.
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.
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.
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:
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?
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?
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.
What I am trying to do is have an input box where the user inputs a word(s), the a button which onclick changes the user's input data so that each line is modified to have a "<<" before the word and a ">>" after.
It works just perfectly if left alone, but I need to replace every letter inside this string, adding those style and span tags around each and every letter. So if I add another line to this code, like this:
I have a web page that tracks clicks on certain hyperlinks. I am using attachEvent() to attach to the document onClick handler, for IE browsers. It works fine, except that for about 1 out of every 6 clicks, I get 2 to 4 click events for a single click. I know this because each time the hyperlink is clicked, I write a record to a MySQL database. I write the record to the database by setting the SRC property of an IFRAME on the page, to a tracking script.
If I look at the database, for 1 out of every 6 clicks, I see 2 to 4 records for the same click event (occassionally as many as 6 records). They are at least 1 second and at most 7 seconds apart from each other.
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.
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.
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?
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.
I had help with the following script. But, it only works with specific ID, which I have to specify in the javascript code. If I wanted to have multiple sets of selection lists, I would have to duplicate the entire javascript block, which I do not want to do.
My question is, how can I make this script not have hardcoded IDs, and let those be declared where my onchange is? Is this possible? Code:
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>