mardi 3 novembre 2009
Underscore.js
for more details : http://documentcloud.github.com/underscore/
mercredi 28 octobre 2009
Des espaces qui s'ajoutent sous les images
Pour éviter ce genre de comportement qui peut parfois gêner le contenu de votre page :
- un display :bloc pr l'image
#img { display : block }
ou
- un vertical-align : bottom
#img { display : bottom }
mardi 1 septembre 2009
Problème de float
juste à préciser , on rencontre ce problème sur les naviguateurs conformes aux standards , ce qui n'est pas le cas sur le Fameux naviguateur IE(celui qui joue toujours le méchant 'naviguateur':D )
Pour voir le problème , on va prendre un petit exemple :
----------------------------------------------------------------------------------
Notre style :
#conteneur{
border:1px solid red;
width:500px;
padding:10px;
margin-bottom:20px;
}
#conteneur .div1{
float:left;
background-color:green;
width:230px;
margin-right:10px;
}
#conteneu .div2{
float:left;
width:230px;
background-color:yellow;
}
NB : le code html n'est pas autorisé , alors vous essayé de créer la page
Alors vous allez remarqué que le conteneur ne prend pas en compte les deux div , et les blocs en dessous monte en haut ..
Alors pour résoudre ce problème , on a plusieurs choix :
La propriété "clear" ( qui va nous sauver de cette problèmatique de float ) permet de gérer le contenu autour des éléments flottants et peut "pousser" un conteneur pour intégrer les éléments en float, et on procèdera comme suit :
Notre style:
#conteneur{
border:1px solid red;
width:500px;
padding:10px;
margin-bottom:20px;
}
.div1{
float:left;
background-color:green;
width:230px;
margin-right:10px;
}
.div2{
float:left;
width:230px;
background-color:yellow;
}
.spacer{
clear:both;
}
Sur la page que vous avez déjà créer : on va ajouter un "div" ou un "br" ou un "hr" et on lui attribuera la classe "spacer" après le "div2".
la class spacer a comme prop : clear :).
Sinon on peut aussi faire appel à overflow, qu'on va mettre au div conteneur , et on procèdera comme suit :
Notre style :
#conteneur{
border:1px solid red;
width:500px;
padding:10px;
margin-bottom:20px;
overflow:hidden;
}
.div1{
float:left;
background-color:green;
width:230px;
margin-right:10px;
}
.div2{
float:left;
width:230px;
background-color:yellow;
}
Juste a noter que sur IE , nécessite parfois à définir la largeur du bloc qui aura la propriété overflow :)
mercredi 10 juin 2009
CSS pour l'impression
plus de détails sur : http://www.w3.org/TR/CSS21/page.html
La librairie PHP JpGraph
La librairie PHP JpGraph est une librairie graphique orientée objet de haut niveau et très riche permettant de réaliser dynamiquement des graphiques depuis PHP. Elle est installée, sur le serveur Web ENAC-IT1, conjointement avec la librairie graphique GD (supportant la manipulation d'images JPEG et PNG depuis PHP) ....
Pour plus d'info , visitez le site : http://www.aditus.nu/jpgraph/
mardi 26 mai 2009
Effets secondaires du filtre AlphaImageLoader en cas de positionnement absolu
http://covertprestige.info/test/47-alphaimageloader-absolute.html
lundi 18 mai 2009
Using Images as Labels in Internet Explorer
What the label does is create an association between its contents and a control on the page. In most browsers, clicking on text or an image within the label will give focus to the area. In the case of a radio button, it will select it and in the case of a checkbox, it'll alternate between the two states (checked and unchecked).
Internet Explorer, however, has a bug where clicking on an image inside a label tag does nothing. (Actually, I should say nothing useful because with radio buttons and checkboxes it looks like it tries to select the control but never does.)
What I've done is put together a quick bit of unobtrusive JavaScript to "fix" the problem. Albeit, only for people with JavaScript turned on.
http://snook.ca/archives/javascript/using_images_as/
mercredi 29 avril 2009
Masked Input Plugin(jquery)
Pour plus d'information
http://digitalbush.com/projects/masked-input-plugin/
mercredi 15 avril 2009
mardi 31 mars 2009
7 Principles Of Clean And Optimized CSS Code
Some of you may remember the days when 30KB was the recommended maximum size of a web page, a value which included HTML, CSS, JavaScript, Flash, and images. I find with every new project with even the slightest bit of complexity, it’s not long before that 30 KB ideal is well out of my reach. With the popularity of CSS layouts and JavaScript-enriched web page experiences, it’s not uncommon, particularly for large sites, for the CSS files alone to jump well beyond that 30KB ceiling.
But there are some principles to consider during and after you write your CSS to help keep it tight and optimized. Optimization isn’t just minimizing file size — it’s also about being organized, clutter-free, and efficient. You’ll find that the more knowledge you have about optimal CSS practices, smaller file size will inevitably come as an direct result of their implementation. You may already be familiar with some of the principles mentioned below, but they are worth a review. Being familiar with this concepts will help you write optimized CSS code and make you a better all-around web designer.
mercredi 4 mars 2009
Handling clicks outside a specified area in jQuery
h4 title, mimicing the functionality of an ordinary drop down list. I wanted to extend this functionality to hide the list when the user clicked anywhere outside the containing div. Here’s the markup for my control:pour plus de détails :
http://rob-bell.net/2009/02/handling-clicks-outside-a-specified-area-in-jquery/
lundi 23 février 2009
jQuery 1.3
On: IE6, XP
jQuery.com uses pngFix, which uses ("img[@src$=.png]"). The "@" now doesn't work with 1.3 and causes an unhandled exception error on most pages of jQuery.com.
mardi 17 février 2009
jeudi 15 janvier 2009
PHP optimization tips
2. Avoid magic like __get, __set, __autoload
3. require_once() is expensive
4. Use full paths in includes and requires, less time spent on resolving the OS paths.
5. If you need to find out the time when the script started executing, $_SERVER['REQUEST_TIME'] is preferred to time()
6. See if you can use strncasecmp, strpbrk and stripos instead of regex
7. str_replace is faster than preg_replace, but strtr is faster than str_replace by a factor of 4
8. If the function, such as string replacement function, accepts both arrays and single characters as arguments, and if your argument list is not too long, consider writing a few redundant replacement statements, passing one character at a time, instead of one line of code that accepts arrays as search and replace arguments.
9. Error suppression with @ is very slow.
10. $row['id'] is 7 times faster than $row[id]
11. Error messages are expensive
12. Do not use functions inside of for loop, such as for ($x=0; $x < count($array); $x) The count() function gets called each time.
source : http://www.moskalyuk.com/blog/php-optimization-tips/1272
mardi 13 janvier 2009
mardi 6 janvier 2009
QEvent 0.95 - a powerful tiny extensible standalone event library for elements and objects
http://code.google.com/p/qevent/
La démo : http://daniel.steigerwald.cz/qevent/index.html