Javascript Opt, Css Transform and Other Stuff
April 01, 2012 No Comments
Just doing some research on new things I’ve found some interesting articles: Javascript optimization: Closure based classes up 20,000 times slower than prototypes The fastest way to loop through an array in JavaScript A re-introduction to JavaScript Patterns For Large-Scale JavaScript Application Architecture Best way to find an item in a JavaScript array Speeding up JavaScript: Working with the DOM Css transform: An Introduction to CSS 3-D Transforms Understanding CSS [...]
Jquery Dropdowns With Touch Support
February 21, 2012 No Comments
Here is a very simple Jquery code that enables to have dropdowns with touch support on Ipad and Iphone and all other devices with touch events. First add the class touchdropdown to the Html tags with the mouseenter and mouseleave events: <div id="mydropdown" class="touchdropdown"></div> Then just add this code to your Javascript scripts: if("ontouchstart" in window){ $("html").addClass('touch'); } $(".touch .touchdropdown").on('mouseenter', function(e) { $(this).data("touch",0); }); $(".touch .touchdropdown").on('click', function(e) { $(this).data("touch",$(this).data("touch")+1);; if($(this).data("touch")!=2){return [...]
Minimit Gallery 2.0 Guide
January 24, 2012 6 Comments
Here the specifications and api of Minimit Gallery 2.0. In the plugin page you can find the source code and the demo. The Html Api When you use Minimit Gallery you need to specify all the Html items of the gallery, giving them an id constructed with the reference name the item string and the number of the item, this way: <div id="reference-item-0">0</div> <div id="reference-item-1">1</div> <div id="reference-item-2">2</div> <div id="reference-item-3">3</div> <div [...]
Javascript Events Fixes
January 20, 2012 No Comments
Here is a fix for Javascript event that fixed two important problems: Fix the scope of event handlers added with Internet Explorer’s attachEvent method (code taken from Yui Library) Add support to mouseenter and mouseleave events To use just paste on a Javascript file and use the function as you need it. /* * Add Javascript events: support mouseenter and mouseleave and fix scope of event handlers * @function addEvent(obj, [...]