jQuery fans blog and community sharing news, plugins, video tutorials, demos and more.

Good jQuery Plugin Template

This is a good starting point for your next jQuery Plugin. I have created a skeleton example http://jsfiddle.net/jquery4u/kp8bS/ for you to check out on jsfiddle also might be of help to you. jQuery Plugin Template Code /*!   jQuery [name] plugin   @name jquery.[name].js  …

Continue reading →

New Google Analytics.js Snippet Tips

Once again the Google Analytics snippet is changing (evolving) into something bigger and better… Let’s take a look… Default New Analytics.js Script This is currently in beta. <script> (function(i,s,o,g,r,a,m){i[’GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,’script’,'//www.google-analytics.com/analytics.js’,'ga’); ga(’create’, ‘UA-XXXX-Y’);  // Creates a tracker. ga(’send’, ‘pageview’);     // Sends…

Continue reading →

Getting System Fonts Using JavaScript

Just a couple of ways to get the System Fonts using JavaScript. There are ref links below with demos. Getting System Fonts Using JavaScript try {     //adds a swf to the page and reads fonts     $(’body’).append(’<div id="flashcontent"></div>’);     $(’#flashcontent’).flash(  …

Continue reading →

JavaScript location.host vs location.hostname

JavaScript location.host vs location.hostname example for this domain address http://jquery4u.com location.host gives us jquery4u.com location.hostname gives us jquery4u.com You may be wondering, whats the difference? Well host takes into consideration any specific ports also! Try it below! Check out this awesome site below. source: http://bl.ocks.org/abernier/raw/3070589/

Continue reading →

JavaScript Capture IOS7 iPad Screen Orientation Change

Code snippet to capture ipad device change (IOS7) tested. jQuery(document).ready(function($) { //capture ipad device change (IOS7) tested. function doOnOrientationChange() {   // alert(window.orientation);   switch(window.orientation)   {     case 0:     case 90:       alert(’portrait’);       $(’html’).removeClass(’landscape’).addClass(’portrait’);    …

Continue reading →

Page 1 of 50 1 2 3 4 5 ... Last →
scroll to top