Entries by Génesis

You don’t need jQuery any more!

jQuery used to offer a easy and quick compatible development through all browsers. It avoids dealing with browsers which didn’t support the W3C standard like Internet Explorer. However, nowadays with current updated browsers you don’t need jQuery anymore. Instead of jQuery you should use directly JavaScript. // jQuery $(element).html(string); // JavaScript element.innerHTML = string; You […]

Do not qualify ID rules with tag names or classes

If a rule has an ID selector as its key selector, don’t add the tag name to the rule. Since IDs are unique, adding a tag name would slow down the matching process needlessly. BAD /* CSS */ button#backButton {…} BAD /* CSS */ .menu-left#newMenuIcon {…} GOOD /* CSS */ #backButton {…} GOOD /* CSS […]

Blink and Webkit cannot scale SVG

Chrome cannot scale SVG vertically or horizontally. For this example we will use: Two HTML Tags for images, one without size and the other with a height equal to double width A div container with a CSS background-image <!– HTML –> <img id=”a” src=”http://upload.wikimedia.org/wikipedia/commons/b/b0/NewTux.svg”> <img src=”http://upload.wikimedia.org/wikipedia/commons/b/b0/NewTux.svg”width=”50px” height=”100px”> <div></div> /* CSS */ #a { width: 50px; […]

Sort by table content

How can you sort any HTML table using jQuery? Element 40 ✔ Element 2 ✔ Element 29 ✔ Element 28 ✔ Element 5 ✔ Suppose you only want to use the number. First we must sort elements After that we have to keep going deleting each element and appending again to the table with the new order // […]