The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [jquery]

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

Filter by
Sorted by
Tagged with
108
votes
4answers
20k views

Celebratory fireworks animation

To celebrate an important event, I hastily cobbled together an HTML canvas-based animation. A few concerns I have include: Performance: Does it run reasonably smoothly on most modern machines? How ...
38
votes
8answers
17k views

Rendering a person's time clock record in HTML, with many color-coded conditions

I have coded this mess of JavaScript and a bit of jQuery. Everything here works perfect as intended, however it is a real mess. What would be the best way to clean this up with best practices and ...
35
votes
2answers
2k views

Random clothes generator

For the past four years I've attended a private school which requires its students to wear ties. I've found that it's far easier to figure out what combination of shirt, pants, and tie that go ...
27
votes
1answer
924 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 ...
27
votes
1answer
391 views

Managing network address information

I'm a developer at a networking company that really has no peers that work above me that I can use for any sort of sounding board for my code, so it's just me. I was wondering if anyone would be ...
24
votes
9answers
36k views

Set of jQuery .onclick functions

I am hiding and fading in different content on the same page using jQuery to hide() and fadeIn() the content depending on which ...
23
votes
1answer
36k views

Handling Hover Events on a Touch Screen

A website I have designed uses a nav menu that shows submenus on :hover. The initial site did not use any responsive design: it targeted only the desktop ...
21
votes
6answers
6k 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 ...
21
votes
1answer
5k views

Writing a better alternative to jQuery Autocomplete

Over the last months I have been writing a jQuery plugin called Better Autocomplete (Code on Github). It originated from another project, a Drupal module called Linkit, but I decided it should be a ...
20
votes
2answers
279 views

Stack Exchange Post Reminder

I've created a UserScript for adding follow-up reminders to any post (question or answer) here on the Stack Exchange network. I did this in response to a stackoverflow meta post feature request which ...
20
votes
1answer
14k views

Draggable Resizeable Box

This is my first angular code. I've been working with jQuery for a while, so I don't have the same approach. I'm looking for advice and code improvement. The following code has 3 directives: ...
18
votes
2answers
2k views

Custom JavaScript validation using the factory / module patterns

I am in the process of diving a bit deeper into JavaScript development and am looking at some common language patterns (module, and factory in particular). In this code, my aim is to create a re-...
17
votes
4answers
28k views

Mark rows with identical values in a table

I have an simple algorithm which marks table rows with identical entries blue. The problem is that this solution takes a lot of time. Has anyone an idea how to improve the speed of this? ...
16
votes
3answers
1k views

Using a navigation menu to help keep material organized

I'm working on a personal project to keep different snippets/examples/small projects of mine organized. I want to make the most of my page width, so I decided to write a navigation menu that slides ...
15
votes
2answers
1k views

Is this form submission validator professional?

I have written some jQuery code for AJAX form submission: ...
15
votes
5answers
883 views

Increasing opacity based on an element's location

I've got a piece of code that takes an element, checks where it is, and if it's beyond a set place in the viewport, make the opacity increase to 1. I've made the code so that it only runs the checks ...
15
votes
2answers
1k views

First HTML5 game: Snake

Here's my first HTML5 game: a really simple snake. I've never made a game before and haven't had too much experience with JavaScript. Fiddle ...
15
votes
3answers
710 views

Displaying RSS feeds from Google Feed API as HTML list

What it does is: Reads from a RSS feed using Google Feed API Shows the list in an unordered list How good/bad is the code snippet? ...
15
votes
3answers
304 views

Simplifying a repetitive event handler

Is there a more efficient way of writing this? It seems like so much redundancy that this can be greatly reduced. Basically the only difference is if isNodeWebkit ...
14
votes
5answers
984 views

Animating one of three boxes based on a form value

Is there a better way to do this without using if or case statements? ...
14
votes
3answers
2k 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? ...
13
votes
2answers
1k views

Clickable icon for expanding/collapsing content

The general idea of the code is that I have a + or - icon (".trigger") that is click-able ...
13
votes
1answer
24k views

Click event function that checks to see if form field is valid

What I'm building is a URL builder. A marketing person inputs a URL and can test that URL to see if it's valid, then they select a demand channel and then hit 'Generate Campaign URL'. I've omitted the ...
12
votes
2answers
865 views

Checking conditions before allowing a play button to become visible

I have this code to check a couple conditions before allowing a play button to become visible. Is there anything to do to consolidate this code? ...
12
votes
1answer
1k views

Responsive/adaptive website code

I have all these functions that work together to create functionality on a page. Is the structure of these functions OK? Can I do anything to speed this up or make my code better? I'm not exactly ...
12
votes
3answers
962 views

Image Filter client

I've made an image filtering client for JavaScript that runs on jQuery, Vex and Fabric.JS. You simply include the required files in your html page, along with something like: ...
12
votes
2answers
3k views

Simple star rating system

I'm working on a simple star rating system, and before I move on to actually "tallying" the votes, which I figure I'll just do with $.ajax, I wanted to make sure ...
12
votes
2answers
306 views

BigBrother - A chat room watcher

Originally, this script stemmed from a small script that watched stars and who made them, but a few days after launching, SE patched it so the people behind the stars aren't sent. Regardless, ...
12
votes
2answers
2k views

“War” card game which includes betting “money” as well

I have created a JavaScript based game, which is based on the card game War. I think I am reusing a lot of my code, but I am not entirely sure what I can really improve. I have a lot of functions, ...
12
votes
1answer
5k views

Assigning width and height to specify image dimension using jQuery

After testing my site against GTMetrix, I get warnings on not specifying image dimensions. I am working on a WordPress site. Here is my solution: My first solution was: ...
12
votes
1answer
65k views

Making a simple call to a server

Earlier this year, before I learnt about Code Review Stack Exchange, I gave this answer in response to a question about how to combine ASP.NET, jQuery, and JSON: I keep thinking that there must be a ...
12
votes
2answers
1k views

Microsoft logo animation

I made an animation of the Microsoft logo. It's available as a CodePen doodle, also. Would anyone be so kind as to check my style and say if there is anything I could've improved? (I am sure there is.)...
12
votes
1answer
2k views

Basic chat server and client using WebSocket

Based on Node.js in Action (Manning Publications) chapter 2 "Building a Multi-room Chat Application", I've taken the model they presented (which is all typical ES5 and jQuery) and completely rewrote ...
11
votes
5answers
2k views

Human anatomy quiz

My code works fine. I just want to have your insight and opinions about the way I did it. For example, is it easy to maintain? Does it have good architecture and design? ...
11
votes
4answers
64k views

Different way of writing multiple click functions

I have the following .click() functions: ...
11
votes
3answers
4k views

Coffeescript beautification and refactoring

As much as I try, I cannot seem to get this Coffeescript code to look beautiful (I'd like to think it is possible). I have tried both Javascript and Coffeescript. Just to be clear, this code works ...
11
votes
3answers
808 views

Efficiency of this constantly running time processor for an HTML5 video control bar

I built a custom HTML5 video control bar, and for each second, it updates two readings: Time Elapsed Time Remaining in hh:mm:ss notation, like so: Because of how often this function runs, I want it ...
11
votes
3answers
4k views

Ultimate Tic-Tac-Toe Challenge

This is my attempt at the Ultimate Tic-Tac-Toe code challenge. It uses jQuery to build out the game grid and find the states of all the "buttons" (actually ...
11
votes
3answers
393 views

More elegant way to show | hide in jQuery

What is the best way to optimize this jQuery code? ...
11
votes
1answer
411 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 ...
11
votes
3answers
1k views

Animated JavaScript/jQuery game

This was a code test I was asked to complete by employer, and since they rejected me, I wonder what should I have done differently. ...
11
votes
4answers
2k 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 ...
11
votes
2answers
2k views

jQuery AJAX form using bad practice

I have not worked with jQuery for years so my knowledge of it is extremely limited. I wrote the following form and received a comment elsewhere saying: This is some of the worst JavaScript I've ...
11
votes
2answers
959 views

Trying to learn idiomatic JavaScript and jQuery

I have been doing server-side development for a couple of years, but I am just now getting into doing some client-side programming. As a JavaScript exercise, I created a dead-simple jQuery image ...
11
votes
2answers
4k views

HTML5 / JavaScript Tic-Tac-Toe

As an exercise, I decided to create a simple Tic-Tac-Toe game. It is Ruby on Rails based, but as for now I'm not using the server side for anything (I intend to build up on it in the future, though). ...
11
votes
2answers
1k views

jQuery plugin that makes a slider out of an <ul> list

This is one of my very first jQuery plugins. In short: it makes a slider out of an <ul> list filled with <li> items ...
11
votes
2answers
15k views

Display progress bar to show async request status using jQuery

Instead of using the ProgressBar plugin, this script displays the progress bar for async requests on the page. Could anyone provide any feedback on this, especially if there will be any issues like ...
11
votes
2answers
263 views

Namespacing jQuery/jQueryUi into markup that I don't control

I have a project that I've been trying to get just right for the past three months and it's still not quite there yet. I'm injecting some jQuery and jQueryUI code into pages that I have no control ...
11
votes
2answers
500 views

StackEgg autoclicker

I wrote a quick and dirty auto-clicker for the StackEgg. Any comments, both on code and effectiveness? ...
10
votes
3answers
3k views

Efficient string concatenations with DOM

I form DOM nodes as strings and append them to DOM tree like below using jQuery. ...