Fancybox currently does not directly support a way to automatically launch. The work around I was able to get working is creating a hidden anchor tag and triggering it’s onclick event. Make sure your call to trigger the onclick event is included after the jquery and fancybox js files are included. The code I used [...]
Decode HTML entities with jQuery
Decoding HTML entities can be so easy with jQuery. The following code snippet converts all HTML entities to their applicable characters:
Javascript Location Hash
Bookmark hash “#” sign provides the functionality to target thenamed anchor HTML <a> tag within the same other web pages. When you click on any link text that targets the bookmarked location of any webpage it adds the “#” symbol and bookmark name to the end of the URL. You can place the location.hash or [...]
Javascript: isArray Function
This is a little tutorial of how to check a variable to know if it’s an array in JavaScript. Unfortunately there’s no built-in “isArray” function like there is with other languages (such as php is_array). And, to make matters worse, strings are really arrays of characters. So checking value[0] can give you a valid value [...]
JavaScript: trim function
For whatever reason JavaScript doesn’t include a trim method natively. This means that one of the first tasks for anyone doing any type of string processing (especially form validation) in JavaScript is to write a trim() method (or use a framework that provides one). The two following functions are supposed to be very fast: 1 [...]
jQuery: Animated Scroll to Top
The following Javascript will change all <a href=”#top”> links to scroll to the top instead of the instant jump that normally happens when the link is clicked. Note the “return false;” line. This is required otherwise the default action will be done and the instant scroll will happen instead of the nice animated scrolling effect.
Javascript: Inserting Thousand Separators
This post contains a simple JavaScript function for numerical formatting. It formats decimal numbers by inserting separator characters at the thousands positions. For example, 1234512345.12345 becomes 1,234,512,345.12345. You can also specify other separator and decimal point characters to suit your culture.