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

learn more… | top users | synonyms

0
votes
1answer
20 views

Toggle nav that switches a banner section

I built this toggle nav that switches a banner section between the slider and a map. All works well but I would like to know how I could improve my JavaScript as I am quite new to it. ...
2
votes
1answer
46 views

Disable button when required inputs are not filled in

Currently I'm having a big form, with steps and a lot of complex fields. To make sure the user fills the required inputs and don't make them crazy pushing down the button submit when one required ...
4
votes
0answers
27 views

JQuery Double Timepicker

I'm pretty new on this platform and I want to improve my code skills by posting my javascript code. I'm sorry for my crappy english... I have one year of javascript/jQuery experience but I feel a bit ...
1
vote
0answers
41 views

jQuery plugin for dropdown with multiple select

This is my first time creating a jQuery plugin. As there are many tutorials for jQuery plugins, I'm not sure if my code correct. This is my first draft for my plugin, it is working but I haven't ...
-5
votes
0answers
21 views

How do I refine my code so that it is not so redundant? [duplicate]

I have this code that does not adhere to the OOP DRY principle. I've heard of slider functions that will slide images to left, I also need it to be multi functional for the four document id's that ...
-3
votes
1answer
60 views

Refactoring code to adhere to DRY principle [closed]

I'm relatively new to Javascript and jQuery. I have this code that has a ton of duplicated code and could use some refactoring. I've heard of Object Oriented Programming(OOP) and the Don't Repeat ...
4
votes
1answer
65 views

Form that reveals more fields as each step has been completed

I'm new to JavaScript and jQuery and need input about how to optimize my script: ...
3
votes
0answers
8 views

jQuery Mobile Menu plugin

I would like some opinions on this Mobile Menu plugin I wrote for work. We develop custom WordPress themes, nothing too advanced or anything. I would like if anyone could just take a look and provide ...
0
votes
0answers
24 views

Animate div positioning rearrangement [closed]

I am building a simple push-down effect which affects the position of two containers. So far I have managed to achieve a near-desired effect using fixed positioning for the hidden container, while ...
1
vote
1answer
66 views

Add/remove class event handler

I wrote this if statement event listener to add and remove a class to a couple links based on changed.owl.carousel. However, I ...
-1
votes
1answer
42 views

jQuery button click handler to fill in form fields [closed]

I have this function and not quite sure how to optimize it? ...
3
votes
1answer
74 views

Populating a form with filtered hierarchical place names

My server performs a query to get all country data with Eloquent relationships: ...
0
votes
0answers
34 views

Zend Framework 3 Ajax Form Validation - contact form

I would like to present to you my code vision of Ajax form validation in Zend Framework 3. I am a beginner in Zend Framework and jQuery too, so I don't know that my solution is good and acceptable. ...
1
vote
0answers
37 views

Gradual color change on scroll

I'm a beginner who wants to learn properly how to write code. The following code takes initial RGB values and gradually changes them (shade by shade) to targeted rgb values, scroll by scroll. The code ...
0
votes
0answers
40 views

Handling routing with jQuery + Laravel

Basically, it's a matter of code organization, trying to delegate as most responsibility as possible to the server and keeping JavaScript use to a minimum, mostly as "glue" code between the view and ...
4
votes
1answer
39 views

Everything you might want to know about an element

I am working with a lot of DOM manipulation and need to know several values of an element to determine its position within the DOM and I have written the following to help scrape several of the bits ...
3
votes
1answer
35 views

A script that uses placeholder attribute to show a typing effect

An easy to use type feature that uses the placeholder attribute and setTimer to give the effect of a user typing. Helpful if you need to draw attention to the search box field. I'm looking to know if ...
0
votes
0answers
42 views

Pointer hover animation for a five-star-rating picker

I want to shorten my code. You can see the following code i used many function for addClass, removeClass. But it is not usefully. Can do my work in one hover function ? If yes can anyone help me ? ...
3
votes
1answer
46 views

Structuring basic client side / serverside email form

I've been more than likely doing this entirely wrong for quite awhile and would like to correct that. With the code review I would like to get critiqued on everything. This includes: JQuery syntax/...
0
votes
3answers
20 views

jQuery buttons to show/hide info and search

I've used multiple tutorials to get the exact look for show/hide using jQuery, but now that I've done it's too repetitive, I've tried to edit it using variables, but it didn't work. Is there a way to ...
0
votes
2answers
65 views

Is it possible to use switch case for more than one array.indexOf

I have some set of if conditions for a particular array using JavaScript. activity is the array containing 10-12 items. This ...
0
votes
1answer
61 views

HTML5 Local Storage toggle and save multiple classes

I put together a code will allow me to toggle a class and save it in local storage. Now I need to add 2 more classes to be toggled and be saved in the same manner. I don't know how to iterate ...
0
votes
1answer
73 views

Simple JavaScript quiz app using an external questions.json file

I have a quiz app that gets data from a questions.json file using AJAX, loads them into my script file, and then use Handlebars to compile templates so I don't have ...
0
votes
2answers
37 views

injectOptions jQuery plugin

Over the past year I've found myself moving from back-end development to something more akin to full-stack development. I've created the following jQuery plugin as a test of my hopefully-not-so-...
0
votes
0answers
33 views

JavaScript Wikipedia search using jQuery autocomplete

I was hoping I could get comments, suggestions and input on this project. The goal is to query the Wikipedia API with a search, and present the user the autocomplete options based on an API call that ...
1
vote
0answers
30 views

Populating an HTML table with JSON results

Could anyone suggest a better approach than the one I'm using now? I tried to keep it as minimal as possible but this is the best i came up with. I did extensive research just to get to this point. ...
3
votes
0answers
29 views

jQuery plugin for a lightweight dropdown

I'm working on my first jQuery plugin for a lightweight dropdown. This dropdown behaves just like a ordinary <select>. Before implementing new features I'd ...
0
votes
0answers
23 views

Hovering elements in jQuery

I made this Fiddle with this code, though I'm not happy with it. Is there a better approach to achieve same result with cleaner code? https://jsfiddle.net/bfn0ussy/1/ Code: ...
1
vote
2answers
65 views

Multiple similar event handlers for input validation

I want to reduce my repetitive code used to validate inputs values. For that I'm using: a class associated to the input a condition to validate the input value an event handler First I declare the ...
2
votes
4answers
44 views

Updating a field's change

I'm writing simple jQuery script for updating one field on another field's change. It's working, but I'm trying to write good code and use best practices. Can you please tell me what my mistakes and '...
3
votes
3answers
90 views

jQuery plugin to highlight text spans in various colors

I am trying to tackle two fairly massive concepts through JavaScript and jQuery, the first being object-oriented programming and the second being how to build robust modular plugins with an OOP ...
1
vote
0answers
55 views

Drag to adjust size of two divs

I have a browserify module I've made for resizing two divs I have beside each other. The idea is that I have two panes with a bar between them which I can grab and drag to resize the panes. As one ...
3
votes
0answers
28 views

Glossary Lookup Function

I'm looking to identify any weak points and unnecessarily slow/expensive operations to optimize this function: https://jsfiddle.net/vkoc22kh/24/ Any help is much appreciated!!! Thank you!!! ...
3
votes
1answer
61 views

Price rating approach

I'm pretty new to web development and I don't know if my solution is OK according to the best practices, considering performance and clean code. I have a Merchant model that belongs to a Price model. ...
3
votes
1answer
91 views

HTML and jQuery audio player

I had a task to create simple audio player. So far I managed to do functionalities and all that is needed. Other part of same task was to make it semantic and modular. I read some blog posts and ...
2
votes
1answer
61 views

Logging requests on a separate thread

I have an ASP.NET MVC 5 application that needs to log to the database every request for a specific controller action and every link click that happens on the view of that action. Since the user ...
1
vote
0answers
55 views

Custom jQuery Lightbox

I wanted to make a custom lightbox, so I can easily change or add features. So far I got this. It works, with a few bugs, but I know the code is not clean at all. Also, I think a lot can be optimized ...
1
vote
2answers
22 views

Updating a Drupal web page with content based on inputted text

The intent is to update an existing Drupal web page with content based on text entered into a textbox. The existing page displays data from a database in a table. This code gets JSON formatted data, ...
1
vote
1answer
44 views

Getting client timezone name to use with PHP date_default_timezone_set()

I would like to get the current user's timezone name so it can be used with the PHP date_default_timezone_set(). After looking up a few things I've finally managed to come up with a solution for this. ...
3
votes
1answer
64 views

jQuery Search Suggestion Generator

I'm currently using a PHP shopping cart, and finally decided to implement a search suggestion feature. There are some already available solutions out there, but I wanted to gain control over how mine ...
0
votes
0answers
21 views

JQuery Search Suggestion Generator

I'm currently using a PHP shopping cart, and finally decided to implement a search suggestion feature. There are some already available solutions out there, but I wanted to gain control over how mine ...
3
votes
1answer
40 views

Finding max z-index featuring in the current page

I have to display a cache layer on the whole viewport (to then display a kind of dialog box). Without surprise I create a <div> element with ...
3
votes
2answers
63 views

Create a Promise that resolves when jQuery loads

I'm currently experimenting with async loading of JavaScript and came up with the following trick to detect when jQuery loads: ...
2
votes
1answer
53 views

jQuery toggleClass [closed]

I just wrote this code but I can't find a way to make it cleaner: ...
3
votes
1answer
68 views

“Rasterbation” function to split an image into a grid

I want to create a function that splits an image into many separate blocks that when put together look like the image as a whole, often called a Rasterbator. Given the number of tiles for height and ...
3
votes
0answers
78 views

JavaScript calculator that uses eval

I am new to Javascript and jQuery. I made a calculator by looking at other calculators, codes. I don't know so much Javascript methods, so I stick to eval method ...
2
votes
1answer
58 views

Opening a navigation

The goal of this function is to open a menu with a CSS class (animation is done through CSS transition), call an overlay on top of content and prevent scrolling at the same time. Also, since the ...
1
vote
0answers
9 views

scroll section jquery a singe page [closed]

First I want to remove the href, but the function need to stay in tact. This has to do with the fact that the hover effect is not that beautiful, because I use Bootstrap and my navbar backgroundcolor ...
3
votes
0answers
41 views

Javascript menu with dropDown and Slide effects

Over the last couple of weeks we build a huge Javascript menu. And we might think the whole code is a little bit too much. We are not pros, but came to a quit acceptable solution. (yeah it´s German, ...
1
vote
1answer
38 views

Scroll to top and addClass onClick - then removeClass on .mouseout

The function is to click a button, the browser window then scrolls to the top of the page, then a class is added to a menu item (with CSS to make the sub menu appear). Then when the cursor leaves the ...