On a website we've built, we use two bits of jquery to make an array of images display in an animated loop (seen in the darker blue boxes on top of the homepage). This seems to work fine, but some people (mostly Mac/Safari users) notify us that these loops stuck between images, stop working or display the images in a shifting/flickering manner.I'm on WinVista/FF 3.6, and I don't experience any of these issues.Does anyone know how to make this problem go away? Are these two instances that use the same scripting somehow in conflict?
i've encountered a problem with the way the drag events are handled in this file, but it had an easy fix. I have a slider (a draggable div) and dragging it involves a lot of processing power. The problem arises if the mouse pointer seperates itself somehow from the element being dragged (by, say, a spike in CPU usage or something). the x_drag library file registers a mouseup listener on the object which is being dragged, but that doesn't do any good if the mouse pointer tracks so much as one pixel off the dragged element.
I've encountered this in almost every situation where i have draggable elements. Thankfully, it's a real easy problem to solve: if the mouseup events are registered on the document itself, there's nothing to worry about, because any old mouseup will end the drag.
Since the client user has no totally installed flash player in their computer, so that No need to detect if they have installed flash player. I try to create an alert and I found out that it�s impossible to put a link in the alert. Now I remove the flash installer in my computer, so that the flash in my webpage become a box. I want to happen when they open my webpage that contains a flash; an alert or message on the top was appearing saying that �You do not have flash installed in your computer. Follow this link to get the installer. I try it using alert but the link is impossible to appear.
I have the code below, how could it be modified to loop over and over and reload the xml file each time. Flow would be: load xml, run thruogh code to display each xml node one at a time, when reach last node, start all over, reloading xml file,
I have been looking at this code for two evenings now, and rewrote it 4 times already. It started out as jQuery code and now it's just concatenating strings together.
What I'm trying to do: Build a menu/outline using unordered lists from a multidimensional array.
What is happening: Inside the buildMenuHTML function, if I call buildMenuHTML, the for loop only happens once (i.e. only for 'i' having a value of '0'.) If I comment out the call to itself, it goes through the for loop all 3 times, but obviously the submenus are not created.
I'm looking to send a loop variable (i) to a function inside the loop, but I can't seem to get it to use the value I want, it keeps making it a reference of i and therefore the function is always called using the last value of i rather than the one it was set with.
So if i have 5 Tabs then Tab 1, when clicked, should call DefaultTabClick(0) and so on rather than always using 4 for any of the tabs.
I am doing some studying and we was to create a small loop using either the for loop, while loop or do while loop. I chose to do the for loop because it was easier to understand, but I want to know how to do the same using the while loop. Here is the for loop I have, but I cant figure out how to change to while loop.
for (var i = 0; i < 5; ++i) { for (var j = i; j < 5; ++j) {
I am trying to loop through my top level nav i.e <ul> <li> and then apply that class name to teh sub level menu of that particular top level. So essentially the clas name on the top <li> wil be applied to its sub level items. Here is my code, which isn't working at the moment:
$(document).ready(function(){ var pageID = $('body').attr('id'); var uniquePageID uniquePageID =$("#site-nav ul li",this).attr('id');
I am currently working on a data input website and have a form which is excel style in layout with 10 rows to input the same fields 10 times. I can get the datepicker in each field but when selected it only populates the first field. I know I must put some sort of value or something in the datepicker class but not sure how it works. Any help on this would be great I have attached the code below:
I have while loop, where something is defined via ID, I called it pin_click.
So of course there are a few entries.
And I have the following Code:
Somehow, this Code only works for the first element, I get out of the while loop. The other elements of the while loop ( which have the same Button ) are just doing nothing, even no action in Firebug.
I'm trying my first bit of jQuery code but am familiar with Java programming. I'm trying to create a function that loads a div with an image in it, which will fade in and then after 4 seconds move onto the next image. I want it to create an infinite loop but it doesn't work.
I'm trying to change the src attribute of an image within a loop and I only get the last image in the sequence. I've put a break-point and I can see that listItems contains the right source for all my 3 images, but I only see the last after the initial change from the original source. pausecomp is a delay function.Here's the code for that loop (this is part of a bigger program within SharePoint)
I've many div with sequence of ids like d1 d2 d3 ... and I need to listen to their click event so I'm using a loop to add an event handler to them, Here it's my code:
for(var i = 0; i < $ds.length; i++){ var $d = $ds[i]; var xFunc = function(e){ document.title = "d: "+$d;
[Code]....
But when I click on each of them always the title goes to "d: 4" where 4 is the last value in $ds.
I am just trying to figure out how to do some different things with the for...in loop and jQuery, but now I'm wondering if this is even possible. I made a simple example to test: function tellMeHeights(){ var allDivs = $.makeArray('div') for (mydiv in allDivs){ height = $(mydiv).css('height') alert(height) }} But this doesn't work - the alert box just says 'undefined'. Is it possible to iterate jQuery objects like this, or should I be using something else like .each?
I have a list of elements and I would like to add a class (.event_deleted) to some of them on behalf of the users choice. The goal is to mark with a strikethrough the elements of the list the user selects by clicking an icon I display besides each element.
I have an each loop that goes through all the elements in a certain class. What I need to do is get the ID of the current element in the each loop, but I can't seem to figure out how to. var currentID =$(this).attr ("id"); was my first assumption, but it's not working. [code]The css is just for debugging, not the goal, so alternate ways for me to do that won't help.
i am a beginner with jquery and im wondering how i can make an unfinished loop? i have some code written and i how can i make a loop which is running all the time since document ready.
for example i would change a background color for #block or slideUp this element. this would be also perfect if i could delay this actions and stop the loop on mouseover but this are the question for the future :)
I am a newbie on jQuery. I work on a project which will allow to find a room in a building. On the left of the page there is a plan of the floor, and on the right, a list of the rooms coming from a database. Every room is a link and when the mouse rolls over the link, the room is highlighted on the plan.
I use this function : $('#link_1').mouseover(function(e) { $('#sal_1').mouseover();}).mouseout(function(e) { $('#sal_1').mouseout();}).click(function(e) { e.preventDefault(); }); $('#link_2').mouseover(function(e) { $('#sal_2').mouseover();}).mouseout(function(e) { $('#sal_2').mouseout();}).click(function(e) { e.preventDefault(); }); $('#link_3').mouseover(function(e) { $('#sal_3').mouseover();}).mouseout(function(e) { $('#sal_3').mouseout();}).click(function(e) { e.preventDefault(); });
But as far as I don't know how many rooms I have, I would like to use it in a loop, something like that : var indTab = 1; $('#link_'+indTab).mouseover(function(e) { $('#sal_'+indTab).mouseover();}).mouseout(function(e) { $('#sal_'+indTab).mouseout();}).click(function(e) { e.preventDefault(); });
indTab++; It doesn't work like that. A second idea is to use .each() $("[id^=link_]").each( function() { // all the id's starting with link_ $('#link_'+indTab).mouseover(function(e) { $('#sal_'+indTab).mouseover();}).mouseout(function(e) { $('#sal_'+indTab).mouseout();}).click(function(e) { e.preventDefault(); }); }); No success.