a JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.

learn more… | top users | synonyms

1
vote
2answers
40 views

Use presets to change a form

I intend to populate some fields in a form based on some presets values. The user choose the presets from a list. The following code is working, but as I'm a newbie, I would like to know if I done it ...
-2
votes
0answers
18 views

Access the table cell ,below a given cell in a html table. [on hold]

How can I use jQuery to access the cell (td) , below a given cell in a html table. Here is my table. I want to find out the index of each column in 3rd row belongs to first and second row. ie is I ...
9
votes
2answers
438 views

Checking all checkboxes

Problems: Wanting to check all checkboxes when the checkbox w/id=checkall is checked. Wanting to uncheck the "checkall" box when any other checkbox is unchecked. Solution: ...
1
vote
1answer
46 views

Scroll to specific sections

I have a jQuery code that helps me to scroll to specific sections on mouse scroll. To handle mouse scroll events I am using the jQuery mousewheel plugin. ...
3
votes
2answers
92 views

Showing and hiding text excerpts

Below is my jQuery scriptfile, all the functionality works (except for the click events on IE). I bring this before you guys to ensure I am effectively separating concerns and writing efficient ...
2
votes
2answers
57 views

jQuery range slider change text based on hidden field value

I am working on a jQuery ratings function that uses the Foundation range slider. My current implementation works correctly on 2 of 7 of my range sliders. However, I am quickly realising that my ...
3
votes
1answer
41 views

Single button use to create light box that brings up different content based on the div

My goal is: when you click on the button "word" it will turn into a lightbox. The button will bring up another content box that holds the same profile image as before with a small bio with image ...
-1
votes
0answers
11 views
2
votes
2answers
49 views

Displaying an overlay when hovering over photos

I have some very illogical jQuery code and I want to see if someone finds a better way to do the exact same thing: jQuery: ...
3
votes
0answers
63 views

JavaScript API for REST

I have a REST API, which naturally you can just use HTTP calls (mainly Ajax) in order to send and receive data. I am building a layer of abstraction on top of the raw REST API for JavaScript ...
0
votes
0answers
23 views

Custom post carousel

I created a post carousel (it's being used on a WordPress theme initially), but I've adapted it to just HTML/CSS/JS one. CodePen ...
3
votes
2answers
60 views

Banner Picker in jQuery

I would like to know if my current jQuery code could be improved? If yes, can you give me improvements? ...
3
votes
1answer
42 views

Converting Procedural JS Code to Object

I'm new to JS and trying to improve my code with the use of more organised objects. I have the following procedural code which I have converted to an object. It does an ajax load within main. Aside ...
1
vote
0answers
25 views

Filter CSV file and display it using Highcharts

I created a function which reads CSV file and displays those values in a graphical form using Highcharts. Although it works, I have to read the CSV file twice because first: I need to get all the ...
1
vote
0answers
85 views

jQuery plugin for dynamically sticky headers and footers

I am creating a jQuery plugin to be used to stick the headers and footers of tables (or other list data) to the top and bottom of the viewport while scrolling. (i.e. scrolling down the page, the ...
2
votes
2answers
72 views

Selecting security questions and entering answers

I have a dialog that houses 6 security questions and 6 security question answers. I want to pass the data the user selects and enters from the view to the controller to save the data in session. ...
0
votes
1answer
103 views

Countdown timer in PHP

Using PHP and jQuery, I was able to make this countdown timer. I've searched various books and obviously on Google, but couldn't find this type of approach as used by me here. I sincerely feel there ...
4
votes
2answers
66 views

Marking a new dataTable row as consumed or cancelled

This is working code from a dataTable, which shows the function executed after the row is created: ...
2
votes
1answer
40 views

Submit an array as html form value using JavaScript

I'm sending data from a form with a variable number of fields via an ajax call. Some of the fields are grouped together so I have opted to send them as an array of JSON objects to keep the groupings ...
3
votes
1answer
40 views

Opening & closing active items with jQuery

I'm trying to have the 3 buttons to each open its own list below whilst closing any current active lists open. I've tried my best with jQuery, but it seems so bloated. Is there a way to streamline ...
1
vote
1answer
43 views

Opening and closing active items

I'm trying to have the 3 buttons to each open its own list below whilst closing any current active lists open. I've tried my best with the jQuery, but it seems so bloated. Is there a way to streamline ...
0
votes
1answer
36 views

jQuery-loaded financial report taxes the browser

I load a table in a div using the .load() method. If I look on the console I see the times taken to display the table: 4.98 seconds that firebugs says are spent ...
2
votes
1answer
79 views

Autocomplete search or instant search script for shopify

I have developed a simple autocomplete module for search box in ecommerce website (http://www.cjcharles.com/) built over shopify. Now, as the CMS is commercial, I was forced to use its given API's ...
6
votes
1answer
49 views

Wikipedia Table Scraper

I created this small script to strip the data out of tables that have hyperlinks as their <th /> elements. I was hoping to get input on code clarity and ...
3
votes
3answers
75 views

Price calculator (quote) based on word count

I am working on an ad form for a local newspaper. I am not familiar with the programming side of things, still learning. I was able to successfully get the form to count the words, but I need it to ...
2
votes
1answer
39 views

Chaining CSS changes in arbitrary intervals

I'm practicing by writing utilities for myself; I prefer CSS3 transitions over jQuery animations whenever possible. This is intended to be used for transitioning multiple DOM elements who's ...
1
vote
1answer
19 views

Nested blocks in JS remapping function

I have an array of objects that have a key attribute with the name of a country and a values attribute that is an array of values that contain data by year: I needed the opposite: an array of ...
7
votes
1answer
46 views

jQuery Dialog for Help popup

I used jQuery-UI and jQuery to create a dialog popup for help snippets on search form inputs. (I am still a novice when it comes to JavaScript, but I am learning fast) Here is the code for one of ...
1
vote
2answers
46 views

Manipulating URL parameters

I am new in JS, I am writing some extra filters on the Interface. So extra filter needs to add or update the parameter in the URL. Option 1. No parameter in existing URL: url = ...
2
votes
4answers
81 views

Hovering over images to show another image whilst fading in & out

I'm trying to figure out how to correctly hover over an image to fade in another image and when you move your mouse out, it would go fade back to the normal image. ...
1
vote
2answers
40 views

jQuery form builder for parsing email array into single input

I have the following in script in my web app which contains a lot of duplication. How can I cut down on this duplication and generally improve my code? ...
3
votes
0answers
23 views

Database syncing playback of videos

I made a website last night that allows people to sync HTML5 <video>s (playing/pausing). The way it does this is by using Ajax to run a MySQL query every 2 ...
1
vote
1answer
48 views

jQuery form with price format [closed]

I have this jQuery form with 4 text inputs. The first one only accepts digits, the second one formats value into 'de-DE' price format accepting 2 decimals, the ...
3
votes
0answers
53 views

Write a HTML table from MySQL tables

I have a piece of code that generates some tables: bp_rows: where I take a snapshot of some "headers" for each row of the table. ...
4
votes
1answer
222 views

Sending Ajax requests and updating DOM

I wrote some ugly JavaScript that is responsible for sending Ajax requests and update the DOM. I'm using it to show user progress of background jobs. ...
15
votes
6answers
1k views

To-do list in jQuery

I'm making a simple to-do list with jQuery. This is my first step in JavaScript and jQuery. How can I improve my code? User enter tasks in input field, submit by pressing 'Enter'. On double-click, he ...
0
votes
1answer
48 views

jQuery “Persona” slider

As you will soon see I'm not the best jQuery developer out there (I'm a designer). At best, I make a prototype barely work. That said, I envisioned this Persona-slider which is just like any other ...
3
votes
2answers
53 views

Add classes onclick and then remove them with onfocus event

Right now I'm mixing JS and jQuery. I would like to find one unique solution with JS only possibly. How can I organize the code according to best code practices? Another thing I need to add is a ...
1
vote
0answers
28 views

Appending a group name to each committee member

I wrote this script to get text, if it equals, append the name of the group to a person's information. I know using .each() is gpu intensive and this feels like a ...
5
votes
1answer
119 views

Checking when capslock is turned on

I've written this JQuery program for checking whenever caps lock is turned on. ...
2
votes
1answer
69 views

Follow-the-cursor eye animation

I have code for googly eyes that is too long. Basically I have variables for each element pupils (one for right -other for left), eyesockets (left, right). I wish I could compress my code so I can ...
0
votes
1answer
74 views

How can I make this jQuery code better so variables aren't repeated and the code is more efficient?

It adds and removes classes from animate.css when mouse events occur. Though I hate how I had to write the same thing twice in both events. ...
3
votes
2answers
63 views

Toggling html buttons and text

I went through a question on SO, and optimized the code according to OP's requirements. I would like a review if it is done properly or not. Here is the code snippet, there are 2 level buttons, when ...
2
votes
0answers
48 views

Truncating text with jQuery but keep the HTML formatting

I repeat here this answer on Stack Overflow. I first posted an answer with not finalized code, as a simple description of the solution I could think, without any test. But later I remained ...
3
votes
2answers
38 views

Check whether all textboxes are filled

I'm doing some simple validations using jQuery to check if all textboxes are filled. ...
2
votes
1answer
63 views

jQuery plugin - image slider

This is my first jQuery plugin (used the jQuery ui widget factory). All code improvements are welcome. GitHub The plugin creates a gallery with one big picture and a given amount of clickable ...
3
votes
1answer
37 views

Algorithm for subdividing html-elements

I am trying to write a module that automatically subdivides div-elements, given some initial parameters. I've prepared the following jsfiddle. What I am doing at the moment is: Setting the width ...
1
vote
1answer
45 views

Close modal and open new modal

I am trying to create a script that shows my login modal on page load. I have a button that opens the register modal and closes the login modal if clicked. Here is the script I am using: ...
2
votes
1answer
34 views

Converting any CSS colour to RGB(a)

For a plugin I'm writing in jQuery I have two optional parameters. For each parameter I do a check for its value. However, I'm curious if I can't write it shorter. Here is the fiddle and here's the ...
8
votes
1answer
69 views

Tic-Tac-Toe game with HTML5 canvas

I know it is a simple game, but what I am doing here is practice what I took in an AI course. I'm also playing a little with the canvas and trying to improve the readability of my code and using ...