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
0answers
5 views

CF/jQ server-side session struct to replace hidden inputs

I have inherited a legacy ColdFusion app with gobs of <input type="hidden"> fields, and a user finally may have used F12/Inspect Element to submit a ...
1
vote
1answer
26 views

Javascript event handling via switch

The application I am developing with has many input fields that interact with one another via the onchange event. When developing started, the goal was to create a framework that makes it easy to ...
2
votes
0answers
62 views

Getting rid of HTML file inputs once and far all

They've always annoyed me, and as a matter of principle, would like to leave my HTML/CSS intact and have the various file upload plugins work with consistent behavior with any styled element. The ...
1
vote
2answers
29 views

Toggle based on checkbox

Can I improve this code ? it's pretty simple and self explain. I have a table which has tasks with several statuses, user can use filter check-boxes to show and hide rows based on these status ...
3
votes
1answer
31 views

Script that checks if an element is in or out of view

I'm looking for some performance suggestions. The purpose is to toggle a data attribute value indicating when an element is either in view or out of view. You can also assign callbacks to be called ...
0
votes
0answers
13 views

jQuery Shooter Game Collision Doesn't Work [on hold]

I'm creating a jQuery web game for my Web Programming Class, and I've made it this far but I can't get collision detection to work, or particles to fire past top and bottom 90 degrees. Also I'm a ...
0
votes
1answer
44 views

Clicking outside a form

On click on a div, a form replace this div. When the user clicks outside the form, the form is hidden and the div is re-show. For this, I implemented this process and I want your feedback, please. ...
4
votes
1answer
36 views

Horizontal accordian using jQuery

Hi I am trying to create a Horizontal Accordion using jQuery, the code works fine. I just want to know if my approach is correct and are there any improvements I could make to the existing code ...
1
vote
0answers
70 views

Overlay on an image

This is, for instance, used on this page, and it overlays the main product picture with some DIVs: ...
2
votes
1answer
73 views

MySQL data fetching without page refresh

I've recently finished a prototype for a little Raspberry Pi website. The main page of the site displays current users found in the room (through bluetooth). I wanted this list updated regularly from ...
3
votes
2answers
66 views

Slick Slider – change contents based on current slide data-index

I wrote the following code for Slick Slider, which changes the content below based on the current slide data-index. I just wonder if there is a more efficient way to do it? ...
1
vote
2answers
40 views

Multiplying 4*4 matrices

I'm multiplying 4x4 matrices for learning purposes. How can I optimize this for performance? HTML ...
3
votes
1answer
38 views

jQuery Browser Sniffer

I'll be honest this isn't all my code, I have made some tweaks to bring it more up to date. The main goal is to do some browser detection and add classes to whichever element we want. I am simply ...
3
votes
1answer
47 views

jQuery AJAX requests - Plugin to Backoff on failure

I'm brand new here, but I've read the guidelines and looked at some up-voted questions. Hopefully I understand how I'm supposed to do this... if not, please let me know and I'll fix my question. ...
-1
votes
0answers
28 views

Running slider animations on a site

I am trying to debug the animations on my site. I did most of the development on my desktop and it all ran fine, but on my laptop, it runs laggy when the slider animates. I think it is a CPU thing, ...
11
votes
1answer
349 views

A game of nodes and pixels

I'm still pretty new to JavaScript. I'm making a game to get a better understanding. Although it's working exactly how I want it to right now, the code could definitely be less repetitive and more ...
2
votes
2answers
30 views

Populating dropdowns that are based on others

I created two dropdowns, a dadand a son that are populated based on two arrays that, hypothetically, can't be changed. When ...
10
votes
1answer
239 views

jQuery code to create web alert

I wrote the following code using jQuery to create a WebAlert instead of using the alert() function from jQuery: ...
3
votes
1answer
48 views

Drills: A JavaScript web application that creates customizable workout routines and reads commands aloud while keeping track of time

Here's the JSFiddle, the GitHub repo, and here it is out in the wild. Note: the application uses Chrome's Speech Synthesis API and only works on Chrome or Safari for iOS7 (oddly enough). It was my ...
5
votes
1answer
43 views

Process chain approach

I've been researching about JavaScript and jQuery function chaining and different callback techniques. I am trying to create a very generic code that allows chaining, and in a way that I may create ...
1
vote
1answer
37 views

Adjusting the height of a div to match that of another column

This code checks whether an image whose parent is .papers.left has completely loaded into DOM and if yes then the background of ...
-1
votes
1answer
33 views

Shorten jQuery code

Is it possible to shorten the following jQuery code into one single block? At the moment, the current code is 2 blocks, but it is practically identical. I tried adding ...
5
votes
2answers
85 views

Lazy loading social buttons on mouse enter

I am using the following code to lazy load some social buttons in my personal blog. Before continue, I would like to enumerate some dependencies first: jQuery 2.1.4; Using Font Awesome 4.1.0 (but ...
3
votes
1answer
48 views

Printing a huge document

I have a web page containing n pages of paged data, showing 20 records at a time. The front end has a link to another page that opens the same data, but without the paging and calls ...
0
votes
0answers
27 views

jQuery plugin that filters and orders boxes with CSS transform

I made this jQuery plugin based on MixItUp and Isotope. In short, one needs to create an <ul> list filled with <li> ...
4
votes
3answers
65 views

Get multiple minimal number from array

I have script for get three values (minimal numbers) from array : ...
1
vote
1answer
33 views

Menu visibility toggle method

I've just created a method that toggles menu visibility. At the moment I've gone with an if..else which checks my flag and acts ...
1
vote
1answer
20 views

Keyboard shortcuts Customization

I have created keyboard shortcuts menu,same as like this stackoverflow keyboard shortcuts.In multilevel. Scenario ...
6
votes
2answers
193 views

jQuery plugin to cycle through text and “typewrite” it out

I have written a jQuery plugin (my first for a long time) that simply cycles through strings of text in a data attribute and uses setInterval to type it out - it's ...
1
vote
2answers
88 views

Reduce jQuery append method

Is this the simplest way to write this? This code evaluates if a textbox value exceeds 20 characters, and then displays the proper message (essentially truncating the string and then adding an ...
3
votes
1answer
85 views

Phone number format and data entry restriction

I created a form that formats phone numbers, allows only allowable keys to be pressed, and converts a lettered entry into its corresponding phone keypad number. Is there some cleanup or better coding ...
4
votes
1answer
39 views

JavaScript Canvas Animation

This animation makes my fans spin up after several seconds, and it seems to have a sub-par framerate. I am trying to understand why, and optimize its performance. Codepen The animation function ...
2
votes
0answers
52 views

Playing with validation

This code is part of an application page, which lets user select existing or add new members, For email and Username it needs to call web services to see if they already exists then validate ...
3
votes
2answers
75 views

Style guide template engine

I'm new to JS and am trying to write a perfectly clean source code. I'm using gulp to concatenate and minify my files, as well as removing comments. So the end result will always be the same in ...
2
votes
1answer
33 views

Compressing .hover

I have 5 or 6 ID's and I need to compress .hover jQuery into smaller amounts. I tried this answer, but due to how he needed only 1 "group" inside the ...
0
votes
1answer
47 views

Fibonacci Sequence - Faster method?

Just decided to make a quickie Fibonacci Sequence via jQuery and I was wondering if anybody can think of a faster way to interpret it? I can type pretty much any number in and it returns in a fraction ...
5
votes
3answers
106 views

Passing JSON object through loop to be used in jQuery Dialog

I'm wondering if there is a better (cleaner?) method than my current implementation. I'm currently encoding a PHP SimpleXMLObject (USPS Tracking API) to JSON and ...
2
votes
3answers
77 views

Using jQuery to restyle page depending on window width

I currently have a JavaScript file that I'm using to fix the navigation on a website I've built. The code is by no means 'DRY', though, and I'd like to fix that issue. ...
4
votes
1answer
64 views

Disable Element If

This is a pretty straightforward library function I've got here. I've had to build it in to about 3 different forms but I never heard of this kind of function anywhere else. I'm trying to make it as ...
6
votes
2answers
280 views

Updating the presentation of a credit card field as the card type becomes known

The goal here is to, add a credit card image, and remove all other credit card images, of a certain input field. I had a even larger code, with a lot of addClass() and removeClass()... then, I shrink ...
2
votes
0answers
46 views

Organising a JavaScript file

I have a JavaScript (jQuery) 'init' file with various variables/event handlers and functions that are currently written in no particular order. I've read that it's good to organise these by declaring ...
4
votes
1answer
140 views

Pomodoro Timer via setInterval

I'm hoping for some input on if my code is DRY or how I could have made it more efficient. I am pretty new in terms of jQ/JavaScript and this took me far longer than I care to admit. I will post the ...
3
votes
2answers
71 views

Present waitlist dialog box if placement is full

I wrote an ugly mess of a JavaScript function that pops up a dialog box based on validation data, when a checkbox is clicked. I am wondering if it can be refactored somehow. ...
4
votes
1answer
56 views

Web-based test settings manager app

Background I work at a company that makes hardware products. All the test settings are stored on the server so it updates all our test stands. I'm currently working on a web-based app using ASP.NET ...
1
vote
2answers
106 views

Making equal-sized tabs to fill the full width of a box

How would you simplify the following block of jQuery code? I use this in a tab-box to size the tabs to style the tabs to the full width of the box no matter if it's 2 or 10 tabs... It works ...
2
votes
1answer
63 views

Synchronizing scrollbars, scrollTop and scroll event loops

I've been playing around synchronizing two scrollbars on a web application using JavaScript and jQuery (1.11.3). So far what I've been doing is any time a scroll event happens on one div, I use ...
4
votes
1answer
43 views

Limiting the number of text fields created

I need to make sure that the max of text fields created is limited to 10 at most. It's a script that I've ripped off elsewhere, and have modified it via help from StackOverflow on a couple of other ...
0
votes
0answers
41 views

jQuery form validator

I am new to the world of jQuery plugins, I don't know why I didn't get into this sooner. What I have a working validator that validates bootstrap styled forms. What I have discovered is that the way ...
3
votes
2answers
44 views

Adding and removing PHP parameters on click

I'm trying to optimize this repetitive piece of code. I think I need to set subsection href as a variable and then figure out a way to merge the functions? ...
2
votes
0answers
58 views

Share on social onclick using jQuery

I have the following code to share my website through some social networks when the user clicks some divs with the appropriate icons. ...