a JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.
1
vote
0answers
15 views
jQuery Plugin for a Form
jQuery plugin for a form. Looking for constructive criticism on my code. Thanks in advance!
...
-3
votes
0answers
20 views
Get button value to array [on hold]
I have 3 buttons with 3 different value. When i click buttons then all values insert to javascript array.How do I do like that?
...
3
votes
1answer
59 views
Javascript equalise heights of groups of elements
This is a small function I have written to equalise the height of groups of elements. Useful for when titles or content will end up being odd length and throw out the visual flow.
To use it you just ...
0
votes
1answer
37 views
JavaScript events architecture [on hold]
I have made one architecture on my project and want to know. Is it good or bad?
...
0
votes
0answers
38 views
Controller for CRUD operations on users
I am working on Angular JS project. Our project contains lot of controllers and each controller having more functions. Please refer below one sample controller which contains more than 6 sections. I ...
0
votes
1answer
35 views
Shrinking header on scroll
I have the following jQuery which applies a class to my fixed header to shrink it when the user is scrolled any distance down the page:
...
4
votes
1answer
51 views
jQuery for revealing secondary menu
Below is some jQuery I recently wrote and I'm quite sure there is a more elegant and/or efficient way to write it. The gist is, when a user clicks on a Primary Nav link, its Secondary menu slides down....
3
votes
1answer
52 views
jQuery menus, click handlers, and scroll effects for a website
So far, I've been using codes based on solutions other people wrote, and I'm trying to learn by modifying those codes. My problem now is that my code ended up too messy (a lot of script tags, jquery ...
-1
votes
0answers
6 views
JavaScript / jquery accordion with preview part of text [closed]
I want to show the first -p- or the -span- of "accord-content" a preview below the headline.
But I have absolutely no idea how.
Can someone help me there?
CSS:
.toggle-section {
...
0
votes
0answers
27 views
Call parent component method from child component
For example, a parent component (called P) has modal and a subcomponent (called S). S has a text area and a button, and when the button is clicked, the modal in the parent has to be called.
My ...
1
vote
1answer
58 views
Responsive jQuery menu
I have completed writing a responsive menu (it uses the HoverIntent plugin) for my WordPress theme and it looks like it is working fine on desktop/tablets/phones.
You can test the code here. Just ...
2
votes
0answers
33 views
Overall assesment of portfolio website
I've just bought myself a domain and recently created a rough draft of a portfolio website.
A few of my friends have looked over the general design of it and given me some positive feedback so I ...
1
vote
0answers
25 views
Statistic Chart With Filter
I have created an app, which show chart, table detail of chart, with filter date. I created app with Backbone and Marionette, chart with Chartist.js, and the filter date I'm using Pikaday.js and ...
0
votes
0answers
4 views
Responsive pagination plugin
I'm working on responsive pagination plugin, it responds to a set of size/page setting passed in on init. In this case I have "pagebreaks" set to display 10 pages at 850px, 7 at 720px, etc.
I just ...
2
votes
2answers
87 views
Using jQuery string replacements to make labels bold
Instead of having multiple statements like the following, Is it possible to club them into one liner in jQuery?
...
-1
votes
1answer
38 views
Push val of input to array
Currently I'm pushing multiple inputs to a array but this is a lot of repeating code, how can I improve this?
...
3
votes
5answers
97 views
Selectable date filters
I created a simple app with Backbone and Marionette. In a view I created an onRender function.
I created a page that displays a Report with a date filter, using a select tag and affect to an input ...
-1
votes
0answers
8 views
I cannot get client side and server side validation to work [migrated]
Hi I have the following forms
...
1
vote
0answers
37 views
Tabbed popup jQuery plugin
A plugin I'm writing that will have essentially be a tabbed popup. However, I feel like the method I use to remove tabs is completely unwieldy.
...
1
vote
0answers
28 views
AJAX Form Creator
I wrote an AJAX Form Creator (in the form of an js object constructor) that takes a form and a callback. I am a decent, slightly okay, completely novice developer, and could use feedback on coding ...
1
vote
1answer
34 views
Add/Remove class on scroll depending on scroll length
I am a jQuery beginner and would like some pointers on whether the following code could be made shorter, or there is a better way to get the same result.
...
0
votes
1answer
32 views
List and post tasks with jQuery
I've written the code below to display a list of tasks from a Flask API. The form and associated .ajax method post to the API, immediately appending the data to the list of tasks. The code is working, ...
0
votes
1answer
40 views
Wait for a “3rd party” element to be appended to the DOM
Let's say we're writing a user script which interacts with a 3rd party site we don't control. We want to open a menu, so we trigger a click on the button and then wait 10ms before accessing the menu (...
5
votes
1answer
106 views
Random quote generator from API
I have built a random machine generator website. It fetches the quotes from forismatic and has a button to get a new quote. When it gets a new quote, the website color changes. It also features a ...
2
votes
1answer
69 views
Displaying dynamic fields for Trac tickets
TLDR: Rendering is too slow when having lots of custom fields and rules. So I need help to improve this javascript code.
#9606: Trac ticket about issue
I have a trac 1.0.8 installed on a ubuntu ...
4
votes
1answer
77 views
Converting a Website Into a Single Page App
I want to convert my website into a single page app. This function does the trick:
...
5
votes
3answers
311 views
Button click handlers for a JavaScript text-based adventure game
I'm pretty new to JavaScript, and I'm trying to created a text-based game. I've written a few scenarios and based on the player's decision I have different scenarios written out. As of now I have the ...
3
votes
0answers
24 views
jQuery modal dialog plugin
I'm working on creating a new jQuery modal plugin. I'm pretty good at jQuery but still pretty new to the whole object oriented plug-and-play style of plugins so I used a different plugin I found ...
0
votes
2answers
73 views
Looping over an array using $.each
The code below contains an array of objects that I loop over and append to hidden input fields in the DOM. As these inputs have no ID, I first select them by name using ...
1
vote
2answers
78 views
HTML structure for a wedding website using FullPage.js
I am fairly new to coding and currently trying to write as much as I can get my hands on. I started off playing around with templates but now I've decided to go without and therefore I am sure there ...
4
votes
1answer
77 views
Javascript contact form validation code
I'm a UI / UX Designer trying to sharpen my JS skills. I wanted someone else to check this code snippet and maybe have a Pro tip to improve or shorten it.
Javascript:
...
1
vote
1answer
67 views
Which jQuery click solution is better? [closed]
I am here at my workplace, and we have a very passionate debate with my colleague about $().click() method vs onclick.
I will ...
0
votes
1answer
66 views
JavaScript DOM modification
I'm thinking about DOM modification performance.
In a perfect way, we alter each element but DOM modification is really heavy and alter many elements at same time froze the browser. I didn't make any ...
7
votes
2answers
55 views
Contra - 30 More Lives
Just for the fun of it, I wanted to have a hidden keypress function on my website that performs an event when the user types in the Contra code for thirty lives. I'...
1
vote
1answer
49 views
Interpreting the time
EDIT: Alternate answer on overflow: http://stackoverflow.com/questions/38487692/how-can-i-interpret-the-time-with-less-code/38492144#38492144
But I really want to keep Jonah's answer here too. Just ...
11
votes
4answers
880 views
Gallery of employees with dynamic filtering
I'm trying to learn how to write better, more efficient JavaScript code and wanted to run this function I'd written by you and see if people can suggest an improved method.
It's basically a people ...
7
votes
1answer
112 views
Make Simultaneous HTTP Requests That Resolve Into a Single Return
This week, in an ongoing job search, I was tasked with the following pre-screening question:
Make two simultaneous http requests. Use the language and library of your choice. Make sure the results ...
1
vote
1answer
48 views
Countdown module that hides an element when a specified date is reached
I have the following piece of code which hides an element when a specified date was reached. I would like to get some tips about do's and don'ts.
Specifically, I'm interested in:
improvements ...
4
votes
1answer
28 views
Change the background color of each section of the page when the user scrolls
I want to change the background color of each section of the page when the user scrolls. The code works but I feel like it's too inefficient
...
4
votes
2answers
68 views
jQuery functions to add corresponding entries of lists
Thanks to this post, I was able to create a working piece of javascript that fits my needs. I have a div/ul/li based table where each "row" has 2 values that I want to have the sum for. Currently the ...
4
votes
1answer
69 views
Tic Tac Toe game made using jQuery and JavaScript
I have created a simple Tic Tac Toe game using JavaScript and using jQuery. I have used bootstrap for the UI. I am just a beginner, so some feedback on the JavaScript element would be great.
<...
3
votes
1answer
68 views
Google Analytics tracking for HTML 5 video player
The jQuery code is for html5 video event GA tracking and I want to make it a little bit more shorter and cleaner. The code works: I am getting all the events, but would like to make it more simple.
<...
1
vote
1answer
38 views
Popup jQuery plugin
I need a code review for my first jQuery plugin. It seems like a lot of code and I want to hear something about my plugin code structure and more.
...
2
votes
1answer
24 views
String building attribute selectors
I'm dynamically selecting elements in jQuery, how can I make it more resilient?
$('[data-example="' + exampleData + '"]').each(...);
I'm concerned that the data ...
3
votes
1answer
86 views
Simple jQuery photo slider
I'm fairly new to front end web development, but finally felt confident enough to create my own jQuery slider. I wish to receive constructive criticism about my code, how I can optimize any line of ...
0
votes
1answer
36 views
Vote-switching optimization
I have 2 <label>s being used for displaying the votes, which is up votes and down votes. There is no problem for the adding or removing votes, but the ...
5
votes
3answers
177 views
Changing color on button click
I have an html button that when the user clicks the button it will change color from blue to red and back. Is there a better way to do this in jQuery?
HTML/jQuery
...
1
vote
1answer
57 views
Loading details of a list of cars
I have a tree view with a list of cars and a webservice to get the details for each car.
On page load, there are no cars selected so the details footer is loaded with all cars.
...
4
votes
0answers
75 views
Colour-matching game
This is a game about matching the right colour. In the first level you start with 3 cubes that each have a different colour. After 2 seconds the colours of the cubes disappear and the cubes become ...
1
vote
3answers
63 views
Toggling image sources
I have a set of images with class = tt like so:
<img src="images/arc_unselected.png" title="Arc" class="tt" />
and I ...