Questions tagged [jquery]
A JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.
2,349
questions
2
votes
1
answer
474
views
Hide menu during user inactivity with jQuery, setInterval performance
I created a script to hide a menu during user inactivity and when the position of my page is left < 2.
I would like to know if I use a good method regarding the performances. It's not too heavy ? ...
15
votes
3
answers
320
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 ...
7
votes
1
answer
4k
views
JSON call for stock info using YQL
I got this code working but it feels clunky. I am wondering if there is a way I can improve it.
(I'm intermingling JavaScript and jQuery). I'm using jquery-1.11.1.min.js hosted on code.jquery.com.
...
6
votes
1
answer
703
views
First time jQuery on xkcd
I'm a first time user of jQuery (and a huge fan already). I am trying to make the comic picture of an xkcd page onclick to the explanation page.
Here's what I've ...
8
votes
1
answer
923
views
Angular dropdown
I have created this little dropdown directive in Angular. The idea is that you create a nav element with a ul inside. The directive prepends a chevron and toggles ...
3
votes
2
answers
205
views
Lots of click handlers that hide one element and show another
I've a lot of code blocks that hide/show some block.
...
2
votes
1
answer
652
views
Node.js chat service
I've built a simple chat server/client on Node.js and socket.io that I would like reviewed. My main concern is making the chat.js (client) running as cleanly as possible (OO) and streamlining data ...
2
votes
1
answer
88
views
Guild Wars: Knights & Dragons - Version 2
I have changed a lot from my original code that I posted about a week ago, you can see that here:
Guild Wars: Knights & Dragons
Now what I need to know is if I improve this code further. Any ...
6
votes
1
answer
134
views
Seven days a week
I use the jQuery Calendar with an underscore template and I wanted to put <li> tags around each week. This does the trick, but it's awful.
...
4
votes
1
answer
40k
views
Movie tickets booking system (Frontend only)
I developed this tickets booking system recently to showcase HTML5 features. I would like you to review it from the UI/UX perspective. Also if there is something more that I can add.
Is it good ...
1
vote
2
answers
981
views
How to automatically insert HTML to a form and obtain the inputs?
For a form I got the markup below, it belongs to an input category and as there can be more than one insertion at it I includded an Añadir button (Add).
I give ...
2
votes
2
answers
376
views
Does this class-adding slow page rendering?
Can you suggest ways of making this more efficient? I don't want to repeat this example for all of my tags that need a class added, if there is a better way.
...
4
votes
1
answer
584
views
A simple drawer using CSS3 and jQuery
I've made a simple drawer using CSS3 and jQuery that works with hover and click. It seems to be working fine but surely there's a simpler way of writing the code.
Fiddle: http://jsfiddle.net/73MpU/
<...
9
votes
2
answers
97k
views
CSS and HTML5 for this fixed header on scroll
When I had to create a fixed header on scroll, I found a few examples on Stack Overflow but they were terrible in the sense that they relied on a fixed page height. Have a look at what I created which ...
4
votes
1
answer
7k
views
Hiding multiple elements' parent container (by child element id)
Summary:
I need to hide several (pre-determined) divs based on a child element's ID.
Caviats:
I can't alter the HTML directly in any way (by modifying the literal .html file). The IDs of the child ...
8
votes
3
answers
2k
views
jQuery Upvote, a simple Stack Exchange style voting plugin
I'm not very good at JavaScript, so it would be great if somebody could review my jQuery Upvote plugin, and point out mistakes, bad practices, or anything suspicious.
The repository is on GitHub. ...
2
votes
1
answer
2k
views
Generate HTML from JSON
I have to generate a lot of tables from different JSON files (up to 20 tables per page). Because it's a lot of data, I really want to keep loading speed in mind. I know it's better to use a non jQuery ...
3
votes
1
answer
8k
views
Updating a jquery progressbar via button clicks
I'm trying to get my progress bar animated. I'd like it to smoothly transition in between the starting and destination values, but only be initiated by clicking the continue button.
The code I ...
3
votes
1
answer
251
views
Getting the current chat room ID
I need roomId (an auto_increment primary key) to locate a specific room to update chat info. My way of doing it right now is ...
4
votes
1
answer
815
views
Hiding and revealing toggle responds very slow
I have a list of 6 items, and each one on click reveals a div that runs 100% wide under the row of list items. The code works, but the div opens very slowly and kind of choppy. Is there anything I can ...
3
votes
2
answers
328
views
Changing a single jQuery plugin option on window resize
I'm looking to change a single jQuery plugin option when the window hits certain breakpoints.
The code below works, however I'm conscious of repeating code and feel there is a more elegant way ...
1
vote
1
answer
221
views
Script that creates an active CSS on link
I have a script that creates an active CSS on link, but I think there are a lot of if statements. Can someone help me refactor this?
...
11
votes
2
answers
5k
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).
...
4
votes
1
answer
122
views
JavaScript scrippits
I was doing writing some various things in JavaScript and ending up writing 2 scripts that proved useful in quite a lot of my other programs and I was wondering if there was anything that I could do ...
3
votes
1
answer
167
views
Navigation bar implementation
I made a navigation bar on the left side of my site. It works perfectly, the only problem is I'm new to jQuery and I think I'm repeating too much code. Is this the case? If it is please help me out.
...
1
vote
1
answer
160
views
Work carousel efficiency
This seems like an awful lot of code and I'm guessing can be condensed and made more efficient somehow. Can anyone suggest this to me at all?
...
0
votes
1
answer
49
views
Is this node replacement code reasonable?
JSFiddle: http://jsfiddle.net/yMSHa/ (Note: Real code uses JQuery 1.4.1)
HTML:
...
3
votes
2
answers
99
views
Major code bloat reduction with jQuery
Basically I want some help in reducing the bloat of this code. I am new to JavaScript so this represents an attempt at learning jQuery by doing. All of this code works as I want it to, but it is not ...
2
votes
1
answer
661
views
Function for adding a tag to the first row of a table is running slowly
I have a jQuery function which adds a tag to the first row of a table. I previously tried using append, however that didn't work. I now have the following solution which is very slow and it gives this ...
4
votes
1
answer
517
views
Form Validation Evaluation
I've been trying several styles of validation code for a form. I was wondering if this is good or needs some improvement or just trash it and use jQuery validator code?
...
8
votes
1
answer
13k
views
jQuery stopwatch
Here is the link to the jsFiddle and below is the code:
JS:
...
3
votes
1
answer
181
views
How could I have approached this responsive image gallery differently?
This gallery uses the Orbit gallery from the Foundation framework (version 3). I've set it up so that on smaller screens it appears as an accordion.
It works just fine, but is there a more concise ...
1
vote
1
answer
234
views
Making a datatable, maybe also with column filters
In case the table has class 'trans' - run dataTable() and columnFilter(); otherwise just ...
9
votes
2
answers
706
views
Optimize this jQuery tab controller further
How do I optimize this code further? Goal is to edit "js-tab" in one place. This is what I tried to follow.
Full code here.
...
3
votes
1
answer
36k
views
jQuery conditional statement to check if a select option has either of 4 values selected
I am working on this project that has a reservation form which allow users specify which sort of service they require. I have a select menu with eight (8) options and I have two divs which would ...
4
votes
4
answers
209
views
Is my web site structured correctly?
I'm trying to get a better handle of code organization and how HTML5 (really HTML) stack works in general. I've worked mostly with ASP.NET Webforms and done some MVC as well. Let me say now, "I hate ...
4
votes
2
answers
94
views
Page loader function
This is the function which I wrote and am currently using in my project. I want to know if there is a better way to write it:
...
1
vote
1
answer
45
views
jQuery plugin creation and declaration for usage with $(). or $
Simple idea: just have a plugin (more a basic function). That I can use with jQuery in different ways it offers, means:
...
2
votes
1
answer
151
views
Speed and ID concerns converting DOM object into JQuery objects
First of all, I am not using JQuery but Cheerio. I have never actually used JQuery in "real life" -- I started with Cheerio, which is a subset and doesn't actually work in a browser environment.
(...
3
votes
1
answer
788
views
Menu Bar Animation Plugin
I'm fairly new to JS/jQuery (a few months), and I think it's time to start getting involved in the community. So I wrote a little plugin. Nothing revolutionary. Really, the project is to write a clean,...
1
vote
1
answer
704
views
Dynamically loading jQuery when it's not available or version isn't high enough
I'm writing a script for others to use on their websites. I'd like to use jQuery in this script. Because I don't have control over what frameworks people use on their sites, I need to make sure jQuery ...
6
votes
1
answer
2k
views
Load JSON file into model using Javascript / jQuery (deferred, asynchronous)
As a beginner I am always determined to improve myself. I've got written the following Code using jQuery that is working fine. However, I am sure that there are cleaner ways for achieving the same.
...
11
votes
2
answers
285
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 ...
2
votes
1
answer
830
views
jQuery for image swapping and some JS for text swapping
I am designing a website for a company that manages buildings/real estate. I did not have much use for a CSS library like Bootstrap or Foundation, except on one page of the website. This page ...
6
votes
1
answer
121
views
Three layout Gallery
I have made a gallery function, this function handles three different types of gallery, one with horizontal nav, other vertical and last one vertical with no nav.
...
5
votes
1
answer
2k
views
Responsive jQuery restaurant menu system
I have a working restaurant menu system - as the user selects a menu it slides into view. The build is responsive, and I've used the 'Debounced Resize() jQuery Plugin'. However, in implementing the ...
3
votes
2
answers
69
views
HTML/Attrs Tester Environment
I have a few objectives (which are working fine, but I want tips in case I can improve it).
Let me try to make this as clear as possible, as this is a much larger project:
There are three move ...
4
votes
1
answer
76
views
Should I differentiate object types by calling methods via variables?
I have three JavaScript objects. The first one serves merely as a prototype. The other two are implementation of a specific type.
...
2
votes
1
answer
221
views
Is this a correct knockout ViewModel setup?
This is my first time using knockout. I'm reading/writing a JSON file with a fair bit of nested data. I had no problem creating the ViewModel to just write to the file, but now that I'm reading the ...
5
votes
1
answer
315
views
Communicating between plugins whilst maintaining context in Javascript
I'm making some changes to a JavaScript plugin on a site I've been made steward over. This main plugin has it's own sub-plugins and I'm trying to make certain aspects modular.
Currently, I'm ...