When no longer working alone for all developers comes time to find guidance in the writing of code. Protocols and standards that make it possible to "read" easily and intervene (more easily) in the code of others.
When we are working on a project more programmers, often of different languages, you must find a common form of writing, internal and external documentation standards in the code. In my work I am usually to interact with:
- Objet-C, C / C + +
- PHP
- HTML
- JavaScript
- Actionscript
- CSS
Continued ...
Who develops to WordPress definitely knows the word slug , usually used to indicate the text strings that do not contain spaces or other "strange" characters. In practice a friendly URL string, which can be used within a URL.
Continued ...
As seen in the post Variety of coding and coding approaches that a developer may have to solve a problem are multiple and diverse for the same programming language used. Here's how some of the most popular JavaScript frameworks have solved a simple function of CamelCase :
Prototype.js
Prototype.js , version 1.6.0.3, explicitly proposes a method camelize() to make the camelcase on a string. The author's approach is quite simple and the code is self-explanatory. In this case it was not made any use of Regular Expression!
1 2 3 4 5 6 7 8 9 10 11 12 13
| ( ) { camelize: function () { this . split ( '-' ) , len = parts. length ; var parts = this. split ('-'), len = parts. length; len == 1 ) return parts [ 0 ] ; if (len == 1) return parts [0];
this . charAt ( 0 ) == '-' camelized var = this. charAt (0) == '-' 0 ] . charAt ( 0 ) . toUpperCase ( ) + parts [ 0 ] . substring ( 1 ) ? Parts [0]. CharAt (0). ToUpperCase () + parts [0]. Substring (1) 0 ] ; : Parts [0];
var i = 1 ; i < len ; i ++ ) for (var i = 1, i <len; i + +) i ] . charAt ( 0 ) . toUpperCase ( ) + parts [ i ] . substring ( 1 ) ; camelized + = parts [i]. charAt (0). toUpperCase () + parts [i]. substring (1);
camelized return; } |
Continued ...
(che nella versione camelize è backgroundColor ). I did not understand if it is a bug or something intentional, the fact remains that whatever the method animate() to jQuery does not work with some CSS attributes, including background-color (which version camelize is backgroundColor ). For example the following code has no effect:
1 2 3 4 5
| "text/css" > < style type = "text / css"> div # box {background-color: # eee; width: 100px; height: 100px} </ style > <! - .... -> "box" >< / div > < div id = "box"> </ div > |
1
| ) . animate ( { backgroundColor : "#f90" } ) ; $ ('Div # box'). Animate ({backgroundColor: "# f90"}); |
To resolve this problem you need to install an extension: jQuery Color Animations . This allows for "animation" attribute backgroundColor and more:
-
backgroundColor -
borderBottomColor -
borderLeftColor -
borderRightColor -
borderTopColor -
color -
outlineColor
Continued ...
Latest Comments
Robert : I rispsoto your questions with pleasure. The idea is really great. I am looking for a solution ...
Sting : @ Darius - you can see an example here: http://www.fight4fun.it/ clicking on: MAPS I hope ...
vik : Giustappunto I'm working on a project and the client asked me to show all the news (which are CPT) in ...
Giovambattista Fazioli : @ paso: absolutely. Simply identifying the field [cci] input [/ cci] you want to ...
paso : Hello I would like to request a service, you can use the datepicker with cform7 I spiegp best I can implement ...