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

learn more… | top users | synonyms

1
vote
0answers
23 views

Load different table contents from mySql database using AJAX and display them

I've written a small application as a part of a much bigger project. This script grabs a bunch of tables from a MySQL database and displays them. The table that is being grabbed and displayed depends ...
7
votes
1answer
83 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 ...
0
votes
0answers
14 views

Triggering approach for an input box

I am setting a value to input box and trigger to hear the change. I would also like to always hear the input change, and for that I made this function. Can any expert please verify the way I did is ...
2
votes
3answers
68 views

Playing with colours

I was hoping people could help me review the following page that I've been working on. The page has a simple form that looks at a list of colours and draw a few divs with those colours as backgrounds ...
1
vote
0answers
13 views

Handling pagination on a particular page

I have a Java script that handles pagination on a particular page by using a jQuery pagination plugin. Is there any way to improve the code? ...
5
votes
2answers
62 views

Hide or show if radio button is checked

I was recently working on a project, something jQuery-related for WP-Admin area. I enable post-formats and create metaboxes for these post-formats, so at the end I tried to hide these metaboxes until ...
2
votes
1answer
41 views

Condensing multiple conditionals into function

I feel like I'm repeating a ton of code here and there's got to be a better way to do this but am just completely spacing right now. I basically have an else if ...
3
votes
5answers
101 views

Writing a checkbox with jQuery

If a checkbox is clicked, it will be added to the total, if not, it will be deducted or ignored. (The total number of checkboxes I have in real is 25.) Is there a way to write the code below in a ...
6
votes
1answer
72 views

JavaScript “snow” code

I have worked for a few hours and this is the result: ...
2
votes
0answers
46 views

Programming with PHP & jQuery

I'm programming a system and I want to know if this is the correct way or if there are a better way to do it. Container: I have more fields but I only added one to show you the container. ...
1
vote
1answer
20 views

Appending URL parameters to links

I've got some pages that may or may not load with a ReturnUrl parameter, and some links that will be generated without that parameter (though I've applied a class to them). The site uses jQuery, and ...
4
votes
0answers
45 views
+50

Smoother column resize, page reveal animation

I've been working on this site. The designers original inspiration for the column layout came from this site. I've been trying to get the animation as smooth as possible, to match the smoothness of ...
6
votes
1answer
40 views

Note taking app (saves notes to an array)

I created the following app (only saves the notes in an array so no a proper note taking app). I would like to know how I would make this code more object orientated. JSFiddle script.js: ...
2
votes
0answers
24 views

Pluggin' in a Plugin [closed]

Can anyone tell me if I'm correctly binding an event inside my jQuery plugin? If not, what's the best way to achieve that? Here is my plugin code: ...
5
votes
1answer
53 views

Multi-level image slider

Here is my code I'm working with: ...
1
vote
0answers
24 views

CPU friendly infinite text scroller - velocity

I've done some research today and read a lot about JavaScript performance. I learned that animating using the transform: translate makes a use of the GPU, hence ...
3
votes
2answers
66 views

Speed up loop through JSON

I have the following function that takes JSON and turns it into table rows: ...
4
votes
1answer
79 views

jQuery scroll-prevention plugin

This plugin is for article pages that has a very long main content (left side) and a shorter sidebar. When the user scrolls down mostly the right part will be white space. What this plugin does is ...
3
votes
1answer
29 views

Loading and displaying JSON quickly in PhoneGap app

I have this tap event in an iOS app that I'm developing with PhoneGap. When I click on the left arrow, it finds the desired content and retrieves it from a JSON file. It then displays those results on ...
1
vote
1answer
49 views

Visual increment and decrement button controls in jQuery

I currently have a working implementation of a + and - tank level thingy (I don't really know what to call it). In which will be able to 'add' or 'remove' so-called 'liquid' from the container. ...
3
votes
1answer
74 views

Cleaning up website code

I am a bit of noob to jQuery so I got this jQuery code what I think can be way faster. Does someone want to help me clean it up? Explaining why you did what would be real nice but not needed. The ...
7
votes
2answers
252 views

Set theory clock code

I wrote some JS to power an HTML/CSS "set theory" clock, and I'd like to share what I have so far and ask if anyone can suggest improvements. Specifically, I'm wondering: Should I bother checking ...
0
votes
1answer
20 views

Performing an auto complete look-up and building a form

I have written a jQuery function that is doing an auto complete look-up and then building the form for me. This is working fine but I want to reuse the code so I can have the form rebuild after ...
1
vote
1answer
33 views

jQuery slideshow code - adding previous and next classes a better way

I have a slideshow in jQuery slideshow switching picture automatically every 5 seconds with CSS3 transitions. The current picture has the current class, the ...
1
vote
1answer
24 views

Vimeo API - Loading videos

I know my way around jQuery and JavaScript a little bit but as for optimising, I'm a bit weak but willing to learn new stuff. I'm currently loading videos onto our site from Vimeo when a user clicks ...
8
votes
0answers
152 views

Easiest way to create bootstrap modals that can run javascript in MVC5

I have an MVC5, C# application using the Razor engine. In my application I have a view, called "Index.cshtml". In this view I want to present a bootstrap modal to the user. When presented to the ...
2
votes
1answer
41 views

Dynamically adding and removing HTML classes

I am trying to add an active class to my subnavigation using the waypoints jQuery. I am trying to avoid writing multiple functions to adhere to the DRY idea. The waypoints toggle the function based on ...
1
vote
1answer
34 views

Adding classes with JavaScript

I am working again and got this to work. Is this the best way to write this code? ...
2
votes
0answers
20 views

Refreshing / Cycling through a parsed RSS feed every 5 mins

I am working on a monitor signage display and have a "welcome to RSS" feed with just a title and desc. I have code from feedEk that's been tweaked a bit to parse the feed and cycle it so I only have ...
4
votes
2answers
79 views

Responsive image code

I am a newbie jQuery developer and i have created a responsive image solution where the HTML custom data attributes are used for loading images according to size like desktop, laptop, iPad etc... ...
2
votes
1answer
39 views

Better way to manipulate URL/array

Is there a better way to do this using chaining? ...
2
votes
1answer
31 views

Many onClick handlers that all append different text to one textarea

Hi this code works fine as it is, I just need some help on improving my codes further using the .on("click", function{}) and if possible can this code be shortened? ...
2
votes
1answer
42 views

Simplify double AJAX request for jQueryUI's autocomplete widget

I'm using jQueryUI's Autocomplete widget for a product search. The data is in a database, so as the souce I passed it an AJAX request. My problem is, that I need some data about the currently focused ...
3
votes
1answer
39 views

Counter increment for search volume

I have written a jQuery function which accepts an elementId and an integer. The function then generates a counter which ...
1
vote
1answer
33 views

Toggle dropdown menus for different menu items with Jquery

In a bigger project of mine I'm using angular to create a dropdown menu dynamically and then toggling a dropdown menu for some of the menu items. This is why I got a function that toggles the dropdown ...
6
votes
1answer
62 views

Animations when navigation items are clicked

I'm a beginner in jQuery and am wondering how I could write the following code shorter, since I'm repeating a lot. Working example ...
0
votes
0answers
24 views

Live update calendar

I've made a calendar using a Firebase database so that it live updates. I'm pretty happy with it but I feel like restructuring it to fit the MVC design pattern, however, I've never done anything in ...
1
vote
1answer
49 views

Best practice of HTML DOM template in javascript

Of course the when this select is comes with less options it will be better to leave it like this, and when it comes more then this it better to make it via loop. The question is that if I should make ...
4
votes
1answer
28 views

Responsive Navigation

The following responsive navigation on JSfiddle works well, however I am just wondering whether there is any way to improve what I have done. I am new at JQuery so all help appreciated: JSFiddle here ...
5
votes
1answer
67 views

Algorithmic simplification of Miller Columns

Background Unsatisfied with existing implementations of Miller Columns (used to edit hierarchical data), I decided to re-invent the wheel. Problem Most of the existing implementations are too ...
1
vote
1answer
84 views

Displaying data from JSON in a table

What do you think of my code? I know it is a little rough around the edges but as of two days ago I had no idea how to use jQuery or JavaScript. ...
3
votes
2answers
90 views

Remove, Append, and Resize Using jQuery

I'm trying to essentially replace an element and make it transition smoothly to the new size... I started off trying to work with the appended element itself, but the padding and margins made that ...
2
votes
2answers
51 views

Is this system of text protection reliable?

I've got a text I don't want to be copied by users. To avoid that, I'm using this code: index.php ...
3
votes
1answer
71 views

Dynamically changing available select options

I have the following code working here on JSFIDDLE: ...
0
votes
1answer
21 views

Make sequential fadeIn() promises more manageable

I've two versions of promise code. The page is a simple one - an unordered list with a few items. I am trying to make the items show up (fadeIn) one-after-another ...
2
votes
2answers
150 views
4
votes
3answers
239 views

jQuery duplicated selector

$("#colors_added").html(parseFloat($("#colors_added").html()) + 1); This JS line makes my IDE go Duplicated jQuery selector ...
2
votes
1answer
39 views

GIF background rollover

I made a cool roll-over in CSS which displays an animated GIF when the parent is hovered. Codepen The problem is that I will have about 40 .day like that, all playing the animated GIF behind the ...
3
votes
2answers
43 views

JavaScript/jQuery string handling

Recently I wrote some code to take two arrays of data and create a title. Each array could have 0-n elements. However, the multiple if statements seem messy to me. ...
6
votes
1answer
335 views

Restricting user to one open tab in browser

I had a requirement to restrict my web site's users to just one open tab in the browser. I am aware that this is not the best thing to do in terms of general user experience guidelines but its an ...