Tagged Questions

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

learn more… | top users | synonyms

0
votes
0answers
3 views

jQuery-Keyframes allows dynamic generation of CSS3 keyframes with callback events

I want to learn best practices for structuring these kinds of small jquery plugin libraries. I believe I am using a bad design pattern and what I was going for is fewest line numbers and minimal code. ...
0
votes
0answers
13 views

How to set aria-hidden attribute on JQuery Show/Hide functions [on hold]

I need to change(set if not exist) aria-hidden attribute when call JQuery Show()/Hide() finctions. This is showHide function from JQuery 1.9.1 I added only 2 lines of code: ...
0
votes
0answers
14 views

Changing the text of a button depending on the visibility of a table [migrated]

I'm trying to change the text of a button when a table is visible or not with jquery. The problem is that jquery .is(":visible") don't appear to do it. ¿What I'm doing wrong? I supposed that ...
-4
votes
0answers
11 views

Need help making jQuery Transit transition repeat [on hold]

Here is my code: http://jsfiddle.net/de74ezo5/14/ So what I was trying to achieve here was to make the pink header collapse and stay fixed at the top of the page after scrolling past the top red ...
3
votes
1answer
51 views

Refactored nearly identical HTML forms

I have two forms in my HTML page. Both share a set of input elements (not a part of any of the forms, but rather residing separately). Besides that, the forms have their own input elements as well. ...
4
votes
1answer
49 views

(Swedish) Calendar of the year 2015 using Firebase

I've made a calendar for the year of 2015 using Firebase for real-time updates when something changes in it. I'm quite happy with it but I'm interested in getting some feedback on my Javascripting ...
-2
votes
0answers
9 views

How to Add Loading in Jquery the following [on hold]

Please Anyone Help ...
3
votes
2answers
46 views

Hide / Show panels depending of value of a dropdown

According to the value of a dropdown menu I have to show/hide two panels. For option 'derive' and 'reject' I should show the comment panel, and just for the 'derive' panel I should also show a ...
2
votes
0answers
29 views

Paper.js slow resize

I'm currently in the process of redesigning and coding my website, for which I'm wanting to use paper.js to draw on canvas. Currently the only project page I have is using a basic random ball ...
3
votes
2answers
158 views

Wrapping jQuery empty() To Include A Callback

I needed to write a method to extend the jQuery empty() function to include a callback. Since I didn't want to mess with namespaces, closures, etc, I instead wrote a regular function to wrap empty(). ...
1
vote
1answer
47 views

C# lambda expressions as array extensions in JavaScript

I use a lot of lambda expressions in C#, so I've decided to create some similar functionality in JavaScript. Since jQuery is included in my projects, I'm using ...
0
votes
2answers
91 views

Increment a text field value

So let's take this code which increments a Javascript text field value: ...
3
votes
5answers
42 views

Handing focusing and unfocusing of multiple form fields

Here is a link to my problem ...
1
vote
1answer
28 views

UI-slider widget

This represents a UI-slider widget - there are a number of different widgets on the page. This function is repeated per widget - 90% of the code is the same - the only difference being that each has a ...
1
vote
1answer
50 views

Add a class to an element when it's loaded

I want to add a class to only those <p> elements that have an <img>. So far this is what I have, it works, but I ...
0
votes
0answers
52 views

Sticky navigation using jQuery waypoints

I have built a one-page website with a sticky navigation using jQuery waypoints. Now I just added a highlight function for the menu buttons for when the user scrolls to that certain area. However, I ...
4
votes
1answer
68 views

Custom marquee consumes a lot of CPU power

I've a code which applies marquee to certain elements by using the requestAnimFrame method. However, when I test my application on a lower spec PC (Intel Celeron ...
-3
votes
0answers
25 views

Spot the error(s) in this script [closed]

I'm working on a little text based javascript game and I've been using chromes Javascript console for the output. The 'game' works off a series of methods written into an object called ...
1
vote
1answer
37 views

More maintainable API for wysihtml5 widget

For an HTML calendar with jQuery, I put in event listeners to enable jQuery drag-and-drop that reads and writes to persistence using HTTP get and post with JSON structures. Now I'd like to make the ...
2
votes
1answer
19 views

Making empty cells in Underscore template

From the back-end, I am receiving 8 data. The client requires showing that the row per data is 7, so I have 1 data in balance. I have created empty data and made the empty cells, which works fine. But ...
3
votes
2answers
50 views

Adding markers to a Google Maps map from a source

I decided to make a simple project to learn the Google Maps API. I'd appreciate a review of the code below. I'd like to know what I did right and wrong. The code pulls data from one source and adds ...
4
votes
1answer
66 views

Flood game implementation

There is the implementation of flood game on my GitHub. The app.coffee is the main part of project: ...
0
votes
1answer
39 views

jQuery hide and show option value from a dropdown

I have form with an "add field" button that does an Ajax call to add a new field. Each field contains a list of options to choose from. When is public is Yes, I ...
0
votes
0answers
33 views

Switching pages with css3 and jQuery

I am trying to implement a custom page switcher. In this fiddle I succeeded in doing what I want. Do you think it can be done in a better way, above all performance wise? For example, on iPad (first ...
0
votes
0answers
22 views

App using JQueryMobile and Cordova

I have received a project that is built on Cordova with JQueryMobile. The app is already published on three platforms and is being used by 100K+ users. Now I have to add new functionality in it. But ...
5
votes
2answers
83 views

Reducing code for animation of expanding menus

I wonder if I can reduce the code to optimize it better? ...
3
votes
1answer
56 views

Database of Pokemon

I've just started to write jQuery and have just written my first code using ajax calls. I'm fetching data from the pokeapi and am using it to random generate new pokemon. I have refactored it as ...
2
votes
0answers
67 views

Loading screen animation

I am trying to make a loading screen but my code isn't DRY. How could I make it DRY? I have thought about using CSS3 keyframes but I might have problems cross-platform. ...
2
votes
1answer
100 views

Toggle-item inside a Bootstrap dropdown-menu

I have this working code for a toggle-item inside a Bootstrap dropdown-menu. See demo here. I suspect that it should be possible to improve it : in order to have a shorter code and avoid all the ...
3
votes
1answer
43 views

Dynamic “filtering” list using jquery

I'm building a list of filters for a website user to filter on, such as a product category page. I'm giving the user the option to filter on brandname, model name, or gender. To avoid serverside code ...
6
votes
2answers
109 views

Check image dimensions, calculate aspect ratio, set image dimensions, resize

I have created a set of functions to calculate the aspect ratio of an image, set a height/width on document.ready and on ...
4
votes
1answer
49 views

Checkbox multiselect user interface

I wrote a small multiple select interface in jQuery, and I'm looking for any feedback on code quality/usability. It has to do the following: When check all is checked, all boxes must become checked ...
2
votes
1answer
49 views

Merging nested tables into a single table

I made a function that merges nested tables into a single table. The following function converts the headers. It takes an old table that has nested tables in its rows, takes all the headers of these ...
3
votes
1answer
36 views

Changing a video link when hovered

I have three divs that change a video link when they are hovered. I have the code working in three different blocks but I am not sure how to combine them since it is very repetitive. ...
0
votes
0answers
33 views

Keeping variables in scope with JS Module Pattern and Jasmine

I am looking for some pointers/feedback on how to write better modules and simple tests. This is a simple module which displays (unfortunately an infame for now — yes I know it's bad) the user's cart ...
2
votes
0answers
78 views

Simulate the way that php receive the form

Lets say I have this form ...
2
votes
1answer
175 views

Call html() on two jQuery selector objects

In my webpage I have two places where I need my JavaScript to write dates. How to do it in one go? Selectors: ...
5
votes
1answer
47 views

Clearing and Loading Data on HTML Form Fields

What I'm trying to do: I have a single bootstrap modal which contains a form that I'm using to ADD records and at the same time UPDATE. What I have: A two buttons to SHOW this modal that calls a ...
0
votes
2answers
19 views

Adding cells to a table

I'm calling the below 2 function once per Cell in a table with over 135 columns and over 200 rows (that is 134*200 = 26800 times, I'm not running the functions on ...
4
votes
2answers
129 views

Get <TH> texts into a tab separated string

table_with_headers = $(this.dom.table).find("thead tr th").map(-> $(this).text() ).get().join("\t") Can one write it nicer? I especially dont like the inner ...
4
votes
1answer
37 views

Select the one table before my link

I need to select the <table> before the table where the link I clicked. I can't use IDs, because I don't want to edit my jQuery every time I add a new table. ...
1
vote
2answers
96 views

Loading div sections from separate files

I am loading divs from separate HTML files into a div on the index.html page. This is being done using jQuery's ...
42
votes
3answers
1k 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 ...
5
votes
1answer
225 views

Shortening jQuery array

In short, the code picks up to 9 different ids from li in jailplayer. If a hillside, it ...
2
votes
1answer
54 views

Underscore template conditional can be reduced

I have 11 data items and would like to print them as a group. Each group will have header and at the end of the group I need to print continue label. For that, I ...
2
votes
1answer
59 views

jQuery and CSS3 slideshow

I have built a slideshow using jQuery and CSS3. jQuery is used to trigger class changes (.slide1, .slide2 ...) on the slide container (...
1
vote
1answer
50 views

Populate dropdown B on selection in dropdown A

On selection from drop-down A (HTML select) I need to populate another "sub"-dropdown with a different list of values. For instance, on selection of country in ...
2
votes
1answer
76 views

Multiple jQuery hidden element toggles

I have a handful of images working as jQuery toggle switches - Showing or hiding an element on a click event. The code below mostly works as intended, but I'm fairly certain I'm using a lot of ...
4
votes
2answers
73 views

Multiple uses of $window.scroll

I'm using $window.scroll twice in a jQuery script for different uses. Should I try and combine them? ...