a JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.
2
votes
0answers
44 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
33 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 ...
-1
votes
0answers
11 views
US MAPS loads HTML file using jQuery into another DIV [on hold]
I need help with the jquery on this site. The jquery is supposed to open an html file in the div to the right of the map. It seems to work in every browser that I try, but in some browsers, nothing ...
3
votes
3answers
58 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
26 views
Stability and utility of this javascript class for chaining CSS changes in arbitrary intervals
Self-taught developer trying to get better at designing software (ie. moving beyond mere syntax or task execution).
Practicing by writing utilities for myself; I prefer CSS3 transitions over jQuery ...
1
vote
1answer
18 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
38 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
41 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 = ...
1
vote
2answers
31 views
Hovering over multiple images to show another image while also fading in and out in jQuery
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
37 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?
...
2
votes
0answers
17 views
Website that syncs playing and pausing of videoss
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
43 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
41 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
218 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
45 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 ...
-1
votes
0answers
36 views
My $.each loop is quite slow. Any methods of making it faster? [closed]
I have a chrome extension that needs to look through every <p></p> on a webpage. My chrome extension looks at the p ...
3
votes
2answers
35 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
25 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 ...
4
votes
1answer
114 views
Checking when capslock is turned on
I've written this JQuery program for checking whenever caps lock is turned on.
...
2
votes
1answer
60 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
71 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
59 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
40 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
35 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
55 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
35 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
41 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
32 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
65 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 ...
5
votes
2answers
231 views
Handling multiple click events of sliding divs
You are first confronted by three links. Each link triggers divs to slide out.
The divs slide out and up to appear as if unfolding. The slide back in reverse when any other link on the page is ...
6
votes
1answer
66 views
Scroll Magic Multiple Scenes
I am using Scroll Magic for the first time and I am in general very new to JavaScript/jQuery. I got it to work but it is very messy and repetitive code.
Here is the fiddle. This is the messy code (I ...
1
vote
4answers
69 views
-1
votes
2answers
51 views
Filling in comment replies when link is clicked
To append data I am using parent() method five times in the code and I think it seems like an ugly way to do this.
...
3
votes
1answer
31 views
User generated filter and content
I am writing a (multi) filter that is created when the user enters in the data through wordpress. There can be anywhere between 2 - 10 filters so I need this to be as dynamic as possible. My first ...
0
votes
0answers
26 views
Replacing code inside div to actual text and then removing script, iframe and other related attributes
Let's take the Stack Exchange example here. When you write code on your "about" section on your profile here on Stack Exchange, the code is automatically converted to actual text/HTML.
For example, ...
1
vote
1answer
37 views
Multiple form inputs droppable
I have a form with 11 inputs that relate to each column on a table, which is displayed above. Each input has an id that matches the a class in the table based on the column name. I want all the inputs ...
1
vote
1answer
29 views
Extracting a list of hyperlinks [closed]
I need to produce a list objCollector with some results:
...
12
votes
3answers
592 views
Slot Machine Constructor
This is a fun little program I made of a fruit machine gambler, aka "slot machine". What mistakes am I making? How can I make this better OOP programming, less spaghetti?
...
0
votes
0answers
23 views
JavaScript process HTML response
This is a function from a Tampermonkey userscript that I use. I am not the author of the original script, but I am trying to make some modifications to it. The script adds output to an HTML page ...
1
vote
1answer
82 views
Use Promise to wait until DOM element exists
I need to create a JavaScript Promise that will not resolve until a specific HTML element is loaded on the page.
I don't have any way of knowing when this element will be loaded, other than to simply ...
1
vote
2answers
77 views
Tabbed user interface with a panel that expands downward
I have managed to get this to work but I am sure there is a better/more polished way to write this can anyone guide me to some shortcuts?
https://jsfiddle.net/zrpgvoL7/4
...
0
votes
3answers
138 views
JS/jQuery finance calculator
I am always surprised by JavaScript and how simple and elegant JS code can look.
I have a piece of code below that simulates a finance calculator. Please share your thoughts, critiques/feedback on how ...
0
votes
0answers
7 views
Making an animation with arc text info
I am making an animation with arc text info. I am repeating the same arc with text info 2 times here. There are ...
-4
votes
0answers
42 views
Bot for ROBLOX game
I am making a bot for a game called ROBLOX and I have finished making it, but I wondered if it can be made quicker and more efficient. Here is the code:
...
2
votes
0answers
45 views
jQuery boilerplate library
I'm working on my library. It's just a boilerplate, wrapping some script code, with helper functions, some plugin implementation, required meta tags etc.
How can I develop this better?
...
2
votes
1answer
51 views
Setting header color on scroll for each post
On this site this site, I have some code which you can see below which figures out the offset for each post from the top of the document and assigns a colour from each post to the header when it ...
2
votes
1answer
29 views
Generic XHR caching function
I've made a simple caching function for my jQuery ajax calls.
I know about the $.ajax() cache setting, but I don't use it for ...
7
votes
2answers
81 views
Animating a block of HTML on scroll
I'm pretty new to client side scripting and I'm still learning.
I've written this JS plugin which animates blocks of HTML (fade-in from left/top/right/bottom) as you scroll down the page.
Everything ...
0
votes
2answers
90 views
Password reset process security
Here is what the reset link looks like that goes in an email to the user:
...