Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  JavaScript to scroll element into view

In AJAX applications, there are frequent needs to scroll some element into view after some modification to the page. For example, after adding an item or updating an element in an admin panel, the page may need to be scrolled to the item added or updated so that we can see the changes immediately.In these cases, JavaScript can be used to scroll the element we want to show. In Vanilla JavaScript, there is no built-in function which can achieve scroll_element_into_view(), but most of modern browsers provide function like window.scrollTo() which can scroll the page to some position. window.s...

16,192 0       JAVASCRIPT JQUERY SCROLLTO HOW-TO


  JavaScript programming style

Douglas Crockford is a JavaScript expert, he is the inventor of JSON. In November 2011 he made a speech "Youtube", during the speech he talked about what JavaScript programming style is.I recommend this speech to everyone, it not only helps you learn JavaScript but also make you enjoying because Crockford is very humorous and he made audience laugh frequently.Next I will summarize JavaScript programming style according to this speech and his article code convention. The so-called programming style is a set of rules of writing code. Different programmers have different programming styles.Some p...

7,852 0       JAVASCRIPT PROGRAMMING STYLE CURLY BRACES EQUAL


  How ScrollerJS works

ScrollerJS is a light weight number scroller module to be embedded in web apps. It provides fancy number scrolling animations. ScrollerJS supports both CSS transition and DOM animation to handle the animation needed. If CSS transition is supported in a browser, CSS transition will be the preferred option for animation. If in old browsers where CSS transition is not supported. DOM animation will be chosen automatically.How does the number scrolling actually work? To transition a number from 0 to 1 and then to 2, it will go through the below process:1. Creating a div panel which will contain two...

5,310 0       JAVASCRIPT CSS GITHUB SCROLLERJS


  ScrollerJS vs Odometer

Both ScrollerJS and Odometer are two JavaScript libraries to transition one number to another number with animation. They provide user a fancy animation about scrolling numbers. These libraries can be used in many scenarios such as user statistic counter, timer or odometer.This post is going to have a comparison on these two open source libraries. Below is a table which lists the features the two libraries have:FeatureScrollerJSOdometerLanguageJavaScript and CSSJavaScript and CSSSizeAround 10KB(Minified)Less than 3KB(Minified)LogicSupport both CSS transition and traditional DOM position(top) t...

14,803 0       JAVASCRIPT ODOMETER SCROLLERJS OPEN SOURCE CSS TRANSITION


  Why 0.1+0.2 != 0.3

In programming languages such as JavaScript, c/c++, Java and Matlab, you will find that you will get unexpected result when doing float point calculation. For example, when calculating 0.1 + 0.1, you will not get 0.3:> 0.1 + 0.2 == 0.3false> 0.1 + 0.20.30000000000000004Don't be surprised of this result, this is the end result of IEEE 754 standard, float point number cannot be accurately represented according to IEEE 754 because:No enough memory is allocated for representing the numberIt needs a range to ensure the accuracyJavaScript uses 64-bit floating point representation, which is the...

9,674 0       JAVASCRIPT FLOAT POINT COMPARISON


  Have you used these JavaScript libraries before?

Are you a vanilla JavaScript developer or a JavaScript library lover?  If you are a vanilla JavaScript developer, please feel free to step away silently because you may not get what you want, but if you are a library or framework lover, please bookmark this page as what we list below are what you may use in the future.There are tons of JavaScript libraries created to ease the headache of developers who have to deal with different browsers on different devices. You may use some of them before such as jQuery.js, Twitter Bootstrap etc. But I bet you have missed some of them. Let's take a loo...

8,535 0       JAVASCRIPT FRAMEWORK LIBRARY


  Undefined property or variable in JavaScript

JavaScript is a weak type language, and also you can use a variable or property where it's undefined. If we don't have correct ways to check whether a property or variable is defined, we may get unexpected results when we try to access the,. How can we check whether a property or variable is undefined?This is actually a somewhat tricky question. Let's start off with some facts about undefined and then see what kind of function is consistent with the ones we care about.JavaScript attaches types to values, not variables. Values can have type undefined; variables either exist (if declared) or the...

11,479 0       JAVASCRIPT ARRAY PROPERTY UNDEFINED


  Inspiring facts about JavaScript

JavaScript has been advocated as the first language to be learned by people who want to program. We have discussed the reasons why we should do so. Recently with the popularity of Node.js, JavaScript has become a full-stack language,  it can be used as both frontend and backend programming language. Today we will give some hard facts which will convince you about the popularity of JavaScript.Just like William Ting said ""JavaScript will stay relevant as long as people use the internet". Yes, JavaScript was created for web, but it's not limited to web; and Internet is bound with web closel...

10,151 1       JAVASCRIPT POPULARITY