a JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.
3
votes
1answer
86 views
Shortening jQuery array
In short, the code picks up to 9 different ids from li in jailplayer.
If a hillside, it ...
-1
votes
0answers
17 views
Portfolio plugin [on hold]
I have create one plugin name "JDs Portfolio", and uploaded it to wordpress.org. Right now, I don't have too many reviews for this plugin, and I also don't want to get bad reviews for that plugin.
...
-2
votes
0answers
12 views
Chrome and IE compatibility [on hold]
I wrote a program using HTML/JavaScript to read an xml file and output the data on that file to a table. It runs fine on Google Chrome, but nothing pops up on IE. I try checking for errors giving me ...
-1
votes
0answers
21 views
Underscore template conditional can be reduced
I have 11 data items. I would like to print them as a group. Each group will have header and at the end of the group I need to print continue label.
For that, I ...
2
votes
1answer
44 views
jQuery and CSS3 slideshow
I have built a slideshow using jQuery and CSS3.
jQuery is used to trigger class changes (.slide1, .slide2 ...) on the slide container (...
1
vote
1answer
26 views
Populate dropdown B on selection in dropdown A
On selection from drop-down A (HTML select) I need to populate another "sub"-dropdown with a different list of values. For instance, on selection of country in ...
2
votes
1answer
40 views
Multiple jQuery hidden element toggles
I have a handful of images working as jQuery toggle switches - Showing or hiding an element on a click event.
The code below mostly works as intended, but I'm fairly certain I'm using a lot of ...
3
votes
2answers
47 views
Multiple uses of $window.scroll
I'm using $window.scroll twice in a jQuery script for different uses. Should I try and combine them?
...
0
votes
0answers
39 views
Show image when in viewpoint of browser window
I am working on a web project and am trying to create a way to detect when an image is in viewpoint of the browser window then load/show the image. Since there are some rather large image that are ...
1
vote
1answer
51 views
Auto-populating user info from database
Auto populate user info from database when user inputs employee number. The same applies when the user inputs name/extension/mobile/email/
Some code is duplicated. Is there any way to make it ...
4
votes
1answer
51 views
Animating a div element
I would like to see how would you write this code for best practices, it will help me to learn from you.
This is my jQuery code I use on scroll event to addClass and animate div element.
...
1
vote
1answer
49 views
jQuery Widget - Progress Tracker
This is a follow up on JS Progress Bar Widget
I've rewritten it as a jQuery Widget Factory widget, attempting to follow that standard as much possible and fixing the various problems pointed out in ...
4
votes
1answer
46 views
Character and word count functionality
I have this JS that has a lot of redundant functionality, and it works but looks unseemly.
I would love some assistance with making this more DRY (Don't Repeat Yourself):
...
2
votes
1answer
28 views
Adding a class to an element in a plugin
I have the following code, and I just added a Class to the element that uses the plugin. I works perfectly, but I am wondering if there is a better way to do it.
...
1
vote
1answer
26 views
jQuery animations with only one callback
I'm aware of doing that 'magic' inside $.when(). How should I achieve same effect writing code more readable ? I read something about a $.Defferer() that I think should help but I don't know how to ...
1
vote
1answer
33 views
JavaScript / jQuery stopwatch
Just as a learning exercise, I set out making a stopwatch without looking up how to do it etc.
I know it will have been done many times before. I'm just looking for some feedback on what I should do ...
4
votes
0answers
26 views
Dragable infinite loop carousel, performance issues on dragging large number (25+) of slides
I have two instances of this carousel to test with, one with 7 slides and the other with 25. They run the exact same code. The 7 slide instance drags smoothly forever as intended, but the 25 slide ...
5
votes
1answer
53 views
JS Progress Bar Widget
Demo of the widget: http://jsfiddle.net/slicedtoad/Lywvbsf4/
It's a progress bar that shows a list of steps and which one is being completed as well as allowing previous steps to be revisited.
It ...
1
vote
1answer
90 views
Reduce CPU usage in mouse-scrolling script
I'm working on a jQuery plugin. The problem is that when I use it I can see a high CPU usage in task manager.
I think the problem is here:
...
7
votes
2answers
84 views
JavaScript Validation
Bit of a preface on my motive: I'm self taught and have never really worked in a collaborative environment. My only benchmark for quality is "does it work" and I've never been really subject to peer ...
3
votes
2answers
54 views
Performance of a method to mask all but one rectangular element on the page
The point of this code is to mask a page where the user is editing the page's 'body' content. This is in a CMS. The rest of the page is the website template (i.e. header, index bar etc...). I've ...
1
vote
2answers
17 views
Enable and disabled multiple inputs
I have to enable/disable multiple inputs when a select change. It works but I want to do it better. How can I improve my code?
...
3
votes
2answers
60 views
Swap images on click with specified image
I am new to jQuery and needed a solution for the following problem:
There are 3 images in a row and when the user clicks on one of them all three pictures are hiding and instead another image shows ...
1
vote
0answers
32 views
Is it long polling or short polling?
I wrote the following script and php code for long-polling architecture by googling references, I would like to know if this is long-polling or short-polling, ...because I am not sure:
bc_test.js
...
16
votes
1answer
215 views
Javascript Minesweeper (with Stack Snippets!)
As Stack Snippets are live on Code Review now, I wanted to do something quick in it as part of rolfl's challenge on meta. And when you make things quick, they probably get dirty. And when things get ...
3
votes
1answer
41 views
Editing <option> values through a textbox with jquery
I've written a script that will allow me to enter a serial number for each received product, in-line in a table. First you enter the amount received, which increases the size of the ...
3
votes
1answer
57 views
jQuery menu: hide and show on click
I am new to jQuery and currently practicing. I wrote a little piece of code to show and hide a navigation on click and change the text of the button when the navigation is opened and closed.
I am ...
6
votes
1answer
148 views
Thumbnails for bootstrap carousel jQuery plugin
Codepen: http://codepen.io/srkimir/pen/mGbrf
Github: https://github.com/srkimir/thumbnails-carousel
While you slide left or right appropriately, thumbnails gets selected and change their opacity to ...
3
votes
1answer
47 views
1
vote
1answer
45 views
Checking form input for an AJAX request
I've made a few functions to check form input for an AJAX request. I am still getting used to JavaScript and some of these AJAX requests. I am looking for any suggestions to better work with ...
3
votes
1answer
37 views
Responsive menu highlights page with JavaScript
This is a responsive navigation menu (pure css), that highlights the page with a short JavaScript I found online. I have it all working, but the CSS is totally a mess. The menu is actually a PHP ...
2
votes
2answers
70 views
Using jQuery and AJAX process a form with PHP
I'm looking to collect form input and pass it to a file called processing.php with AJAX
JS:
...
6
votes
3answers
149 views
Efficient if-statements and how to use variables
The first part of the code (above the in-code comment in the middle) looks messy.
I know I could use variables to make it cleaner, I just don't exactly know yet how can I effectively apply those when ...
5
votes
1answer
101 views
Transforming jQuery form code into clean code
The following JS code handles when the form is submitted and some little extra stuff.
I'd like to have it reviewed on the following aspects:
Readability
Efficiency
Usability
OOP
It works exactly ...
3
votes
1answer
48 views
Solving the Shortest Path problem (little bit of TSP, too)
Some background info:
I'm working at a shipping company and the company's web developer has been fired a week ago. My boss knew that I had some knowledge in web development, so until we get a new ...
13
votes
2answers
1k views
Is this form submission validator professional?
I have written some jQuery code for AJAX form submission:
...
2
votes
1answer
37 views
Creating a slider to adjust the width and two click events
I have some JavaScript that was put together for functionality but I wanted to know if there was a better way to write it. As it stands it's a little hard to read and follow.
...
6
votes
1answer
156 views
Gmail Mouse Gesture
Gmail had this awesome feature and it was discontinued for some reason. Nowadays I have installed a nice Google Chrome plugin for this job.
A couple of months ago I had to develop a similar feature ...
-1
votes
2answers
11 views
DRY Up a jQuery code
I am very new with jQuery and JavaScript and I would like some help to DRY Up (synthesize) a code I am working on.
Tks a lot
...
2
votes
1answer
34 views
Non-restrictive email validation
Just looking to do some super-duper basic email validation and was wondering if my code is efficient.
IE8 compatibility is a requirement.
...
6
votes
2answers
166 views
2
votes
1answer
30 views
Spree Billing/Shipping Address Checkbox
I used JS to re-populate the shipping address into the billing address when a checkbox is clicked. I'm wondering whether there is a more concise/better way to write the code below:
...
3
votes
1answer
43 views
jQuery cycle content of static HTML page
I am making a simple jQuery code that changes the content of a static HTML page when a button (previous/next aka left/right) are pressed. The page is static, so the content that must be cycled (images ...
3
votes
2answers
84 views
Better paradigms for posting JSON from a table?
With a table based interface where users can update the rows by pressing a button. Perhaps there is a better way of doing this, without pressing a button, i.e. post on textarea/row change (could be a ...
3
votes
0answers
52 views
Simple slideshow with jQuery
I've made a very simple slideshow that works by appending and prepending images (on click and every 3 seconds). This is my first time trying to use classes or objects so any help would be great. I ...
6
votes
1answer
67 views
Simple JavaScript Backbone.Js tool to highlight multiple search terms
I wrote a simple JavaScript tool to highlight multiple keywords at the same time in some text. It uses different color for each keyword, and also shows the count of matches.
I'm using Backbone.js ...
2
votes
1answer
40 views
Clicking child view and preventing parent view from running dblclick event
I have a parent view which has a dblclick event handler bound to it. I also have a view which is a descendant of the parent. This child view has a click event handler bound to it.
Currently, my code ...
5
votes
1answer
37 views
Animated magazine
How can I write this code better? I'm doing an animated magazine, so I run and then clean the animation per page.
...
1
vote
1answer
46 views
4
votes
0answers
73 views
JavaScript/jQuery Image Slider
I've just wrote this class for an image slider (it cross-fades rather than sliding, so a class rename may be beneficial). It's my first proper attempt at JavaScript OOP. Can anyone see any real issues ...