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

learn more… | top users | synonyms

3
votes
1answer
26 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
2answers
40 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
0answers
12 views

ForceNumeric plugin [on hold]

I found this plugin on net, and I customized it for maxIntegerPlaces and AllowDecimal (to allow only single ...
1
vote
1answer
23 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
1answer
28 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. ...
2
votes
0answers
34 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 ...
1
vote
1answer
29 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 ...
5
votes
1answer
46 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. ...
5
votes
1answer
61 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
1answer
21 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
2answers
55 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
1answer
49 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, I've used the 'Debounced Resize() jQuery Plugin', however in implementing the ...
0
votes
0answers
23 views

json list dropdown selector for car shop [closed]

I'm trying to do a listdown selector for choose a car model by the user of my shop. but not I access the models of the second trademark. Specifically do not work from the Audi A3 model. I don't know ...
3
votes
2answers
37 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
1answer
44 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. ...
1
vote
0answers
13 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 ...
4
votes
1answer
26 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 ...
2
votes
1answer
26 views

consolidate table td and th query

I have two statements that look like this: $('table tr td:nth-child(' + columnNumber + ')').toggle(); $('table tr th:nth-child(' + columnNumber + ')').toggle(); ...
1
vote
1answer
33 views

Optimize jQuery code includes autocomplete function for different input box with different autocomplete content

I have this code below for autocomplete feature of several inputTextbox. The input box also share same class".wikiInput". When user typed something in either of them, a relevant autocomplete dropdown ...
1
vote
1answer
34 views

jQuery Modal Plugin

This is my first attempt at a jQuery plugin. The plugin is a simple modal window, I'm keen for feedback of whether I've got the principle correct, the usability of the plugin and any improvements that ...
2
votes
2answers
41 views

Interupt redirect to catch potential newsletter signup

This is a piece of code I am working on to reuse in a few places on various websites. It is used to capture name and email addresses for people interesting in registering for something, we want to ...
3
votes
1answer
38 views

Horrible nested if statement for changing CSS based on RadioButton selection

I'm writing away for this website, and I've come into a problem. I need to display only one td based on the corresponding radio button pressed. However, there are ...
4
votes
1answer
47 views

Smoothen page transition for mobile devices

I have next/previous buttons on my site and all they do is slide sections of the site from left to right and vice versa, it is smooth and looks good on a desktop but on mobile devices it is a bit slow ...
1
vote
1answer
20 views

Eliminate nested HTML elements for jQuery animation?

Background When a user leaves a page, if they haven't submitted form data, a button is animated to draw the user's attention. (This is a poor UX choice--all the form data should be submitted--but it ...
2
votes
1answer
37 views

Simplify some resizeable HTML

I am generating a content bar with jQuery, that can be inserted into any webpage. It is a <ul> with two smaller lists within it. Those two minor lists have a ...
4
votes
3answers
63 views

New Game - Am I going down the right path for DOM manipulation?

I find myself using a lot of .find functions within what I'm developing. The reason being that I need to run this same function on a TON of different characters ...
3
votes
1answer
26 views

Re-writing rough JS code with loads of jQuery plugins

I want to include about 10 jQuery plugins in a project but do so in a better way than just pasting them into a JS file. I want to capture various device data and other data passed from the ...
1
vote
1answer
33 views

Is there a way to avoid calling the document with jQuery on click?

I have taken a look at several answered questions on Stack Overflow about jQuery's new (since 1.9.1 upgrade) .on('click','',function(){} and that you need to ...
2
votes
1answer
39 views

jQuery tooltip optimization

This is my second jQuery script: a universal tooltip for my entire web page. It took me a couple of days to research and make it work. Now, I need help from the experts to optimize my newbie code. ...
3
votes
0answers
37 views

jQuery Plugin - HTML5 History State

I've built this small jQuery plugin to work with HTML5 History State functions. It's my first jQuery plugin, so I'm not sure if it's up to the best practices, or what could be done better. Keeping it ...
1
vote
1answer
26 views

Object Oriented Modular Closure

The following is some code I just wrote. I keep wondering as always what I can do to make this more efficient. Please help me make this code object oriented and if anyone could help me write ...
5
votes
1answer
36 views

Form generator for inputting URL, description and link

This is a form generator I created so users can input a URL, description and link. The output will eventually be a JavaScript news slider. The HTML the form generated is irrelevant for now but I'd ...
4
votes
2answers
53 views

slide out navigation bar seems too simple but it works, is it?

http://crystalcleanhomes.com/slide/ There are countless scripts that perform this simple slide-out navigation menu but they are all so bloated and the styles are so convoluted that I decided to make ...
5
votes
1answer
53 views

Expandable navigation menu

I am trying to step to the next level from student to amateur web developer, and I would like to make sure I am not making any web-development no-no's, that's all. What caused me to want to ask SO ...
5
votes
2answers
173 views

How to verify if HTML table sort is stable or not?

I have implemented a HTML table sorting. I actually implemented a sort first using jQuery and then modified it based on the answer to this question for performance as I had done the same mistake. My ...
2
votes
1answer
39 views

Am I optimally closing this modal window?

I have a modal window that needs to be closed, obviously. I've created this piece of code that works okay. But is there a way to optimize it? ...
4
votes
1answer
75 views

Fading and Loader jQuery Improvement

I'm not much of a jQuery coder (more of a PHP coder), except to call a few get values out of class and id and Ajax calls. However, I need to make a checkout system work and one thing I would like to ...
6
votes
2answers
58 views

Optimizing an avatar toggle

I have a link (avatar)#qam-account-toggle and div.qam-account-items, the div containing user account links. I am toggling div on ...
2
votes
1answer
55 views

Search filter list using jQuery

I looked at a search filter code code and edited it to catered to my functional needs. I understood most of the JavaScript except the extend method bit. Can someone explain that? Also, is this the ...
3
votes
1answer
51 views

JavaScript jQuery plugin options. Defaults, User Options, and immutable settings pattern?

I'm writing a jQuery plugin. I'm allowing the user to pass options (optionally-- argument 2 to extend) but I also require some defaults (argument 1), and some things user is not allowed to modify ...
3
votes
1answer
46 views

jquery script for inserting and deleting text

Unfortunately I get 3 warnings at jslint. Could someone please help? I already tried a lot, but didn't get it yet. Here's a jsfiddle: http://jsfiddle.net/KYjF9/21/ JSlint options: ...
13
votes
5answers
769 views

Looking for a cleaner way to write a jQuery function

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 ...
6
votes
2answers
164 views

How can I optimize this father son project?

I made this bit of code that uses jQuery in a simple HTML file to see if my son would think it is fun/interesting and to help me with my jQuery skills. The thing that was hard was the selectors ...
2
votes
0answers
64 views

Insert and Delete (a list of specified) characters/words in headline [duplicate]

I'm very new to JavaScript and I'd appreciate some help. Here's a jsfiddle: http://jsfiddle.net/KYjF9/3/ I'm trying to make that code more elegant and also valid at http://www.jslint.com/ (browser ...
4
votes
2answers
52 views

Simpler way of showing, hiding & disabling elements

I'm currently having this code & looking for a simpler and shorter way of showing, hiding & disabling my elements... ...
1
vote
0answers
32 views

Integrating external jQuery code with edge animate (edge animate runs on jQuery Backbone)

There are two ways I can see of integrating edge animate with external jQuery. Something happens within Adobe edge and triggers something to happen externally or vice versa. 1: When an action is ...
3
votes
3answers
84 views

Grouping similar jQuery functions

I want to group the two very similar jQuery functions into just one. Any idea? HTML: ...
6
votes
1answer
61 views

Private methods and properties in jQuery “lightweight start” pattern

For non-plugin code, I generally use the module pattern, but I'm working on a jQuery plugin and decided to try out the "lightweight start" pattern. The problem is, I find myself needing ...
3
votes
1answer
40 views

Better alternative to $(this).off(“click”)

I have a notification system that looks like this: ...
4
votes
1answer
71 views

Triggers placing and sizing elements for video controls

I have some triggers placing and sizing elements for video controls. It works well enough but mostly through trial and error and I am not sure if there is a better pattern: The full source can be ...