I want to make a for loop with jQuery to reduce code, but it wouldn't work. This is the sorth of thing I want to do: run through an array of <li> and animate them separately with a pause in between.
I want to travel through a for loop of list elements with JQuery, to separately let every list element float downwards. If I do this without a for loop, it works perfectly:
Right now, the array items print out without spaces like "Jane,John,Mary,Sue". I need to be able to work with the items individually so I can format them so they read "Jane, John, Mary and Sue". I thought I'd be able to do something like v[i] + ", " but I get an "undefined" when I try to alert for v[i]. Can someone point me in the right direction? Code:
My website has a flash animation I'd like to replace with a jQuery animation [URL]. I'm trying to create a dynamic statement to grab an array of words from an XML file and loop through replacing the word in a <span> with a random item. Would like it to loop continuously while the page is displayed. The HTML statement is:
<p style="text-align: center; font-size: 2em; font-weight: bold; margin: .5em,0,.5em,0;"> <span>Shred your </span><span id="indexShredItem">paper</span><span>, not your nerves.™</span>
[Code]....
It works great once, but I can't get it to loop. I've tried "for" and "while" loops (no loop attempt is in the script above).
I have a (not too long) paragraph. In this paragraph a few words are wrapped with <span class="emphasize_m"> and <span class="emphasize_xl"> What i want to do is wrap all words in <span> which aren't wrapped already.Then i want to switch all span opacities to 0 (zero).I don't have an idea of how to wrap words separately.
I inherited Javascript and jQuery for a sliding belt (carousel) module. Basically, left and right navigation arrows would appear to the sides of the belt if there were more slides to show.
The jQuery and Javascript code was originally a singleton, so I decided to convert it into a jQuery plug-in in case the belt HTML markup was instantiated more than once. We have a CMS, so multiple belt modules theoretically could be placed on the same template.
Below is test page with two belts on the same page and the associated Javascript jQuery.
My problem is that when you click on the arrows or the slides, I found that the second belt works fine but not the first one. The first one does not show a left arrow when you page to the right. Likewise, the first belt gets mixed up going to the left. Somehow, only the second belt works as expected.
What I would like to do is when I attach my plug-in to a DIV, I want each belt to operate independently of each other (i.e keep its own local variables, functions, etc.).
I am not sure what I am missing here. what I am doing wrong? (You should be able to copy and paste the code into jsFiddle to see how it currently works.)
version of Apycom's jQuery menu; you can find itat http://apycom.com/ and it is looking really good.I have uploaded files, and published it on a test site - www.flexin.beUnfortunately, some of the submenus starting from the second that haschildren elements, it adds the item on the top level in InternetExplorer.Does anyone on this list has any experience with this library?
I have two drop-down fields that are populated separately from the database. Here is my HTML/PHP code Drop-down field #1 <tr class=bodyTRstyle> <td width="35%"><p align="left">Venue</td> <td class=fieldTDstyle width="269"><p align="left"> <select name="VenueName" class=VenueName><option selected><?php echo $VenueName?></option
<?php $SelectVenueQuery="select * from venue order by VenueName"; $SelectVenueResult=mysql_query($SelectVenueQuery); while ($VenueRow=mysql_fetch_array($SelectVenueResult)){ extract($VenueRow); echo "<option value='$VenueName'>$VenueName";}?> </select></td></tr>
Drop-down Field #2 <tr class=bodyTRstyle> <td width="35%"><p align="left">Results</td> <td class=fieldTDstyle width="269"><p align="left"> <select name="GameResults" class=GameResults><option selected> <?php echo $GameResults?></option <?php $ResultsQuery="select * from result order by ResultDate"; $ResultsQueryResult=mysql_query($ResultsQuery);
While ($ResultsRow=mysql_fetch_array($ResultsQueryResult)){ extract($ResultsRow); echo "<option value='$ResultDate'>$ResultDate";}?> </select></td></tr>
This code works well as long as the two drop-downs are independent of each other. The result table has VenueName as an element, so each venue has a set of result records in the result table. This is how I want to change it: The Venue dropdown will remain as it is. Once the Venue Name is selected I want the result dropdown to populate with ONLY the result records containing a match on VenueName that was selected in the venue dropdown. How do I do that? Is it with a onChange Event? What are the changes that need to be made? How do I communicate to the second drop-down what was selected in the Venue drop-down??
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 an ASP.net page where I load a record set server side and upload it into a listbox. I'm trying to do all the movement functionalities of the listbox items client side. Specifically, I'm trying to figure out how to copy selected listbox items from one listbox to another -- on button click. I've searched for a while, but every example that I found moves the actual item into another listbox, I just want to copy the selected item to another listbox.
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'm having trouble with a plugin system that I'm working on. It involves binding a doubleclick with two elements that have the same id. The two elements are different plugins, and load appropriately, however the dblclick binding seems to not change between elements. Here's my code(simplified):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
I have multiple ul with multiple actions on 'button' changes, i.e.:
<ul> <li></li> <li></li> <li></li> <li></li> <--this is to be hidden </ul>
[Code]...
The UL's are to show top 3 items let's say, and hide the rest. When items are hidden on page load [top 3], the Show button is on. When that is clicked, it shows all LI's for that UL and button/link text changes to Hide, and hides all other items of all other items of other UL's apart from their top 3 items.
When the items show, and the text/image is changed to Hide, hide's on click should also hide that UL's items and only show three items for that UL. 3 items are always shown.
I am trying to put the finishing touches on my client's website. The site was built with Wordpress as its CMS. For the site's 'Photos' page, I used the NextGen Gallery plugin to manage and display the image gallery. We (my programmer) made some modifcations to the plugin so that users could upload images from the frontend of the site. That was no problem.
Then I added a jQuery script that toggles each image's description text OFF and ON. It looks good on the 1st page of the gallery, but then if you click to page "2" you get taken to a screen that shows all the descriptions toggled ON. I don't know what's doing it, but something is causing all of these descriptions to show at once, which is NOT what we want.
Here's the jQuery script I am using (it's in no-conflict mode so it plays nicely with the other code libraries in wordpress):
Code:
var $j = jQuery.noConflict(); $j(function(){ $j(document).ready(function( ) {
[code]....
how I can make a 'description text box' disappear/fadeout when another one gets clicked? Right now you actually have to go back and re-click each one before it toggles OFF, which starts looking terrible after you've clicked a few of them.
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) {
Trying to get data from xml file. Got it. Trying add data in class. $(this).find('Category').each(function(){ var menuItem = ($(this).find('Label:first').text()) $(".DfMenu").text(menuItem) alert(menuItem) There are 4 menu item. Alert shows up right but it add same data in all menus one by one. How can I add four different menu item in four divs that is using the same class.
For some reason my loadFirstPage in the following code is unable to find the dynamically created list items built up in the buildGallery function. I have a button in the extended code that calls the loadFirstPage function on a click which works perfectly when I click it
var buildNavi = function(){ var naviTemplate ='<li class="prev"><a href="#" title="Previous">Previous</a> </li><li><span class="current"></span><span class="total">
I am having quite a bit of trouble getting items out of a json encoded array. I have searched this forum tirelessly and can't find anything except more confusion. I'm simply trying to retrieve data from a mysql db via ajax.
select.php: echo $json_encode_data; output is like so: {
[Code]....
Do you need to use a .json file when using .getJSON? I simply want to print data from my select.php file that has an json encoded array. If there is a more simple way to do this without using json encode