$(document).ready(function(){
fTPL_Init();
// Ce qui suit bug avec chrome. Le selector retourne 0 element !!
alert($('div[class^="cdr"').length);
// this line is for testing code only.
// There is big bug here !!!!!.
// The code alert returns 0
// and the following code can't operate...
$('div[class^="cdr"').not('.cdrGlobal').append('<p>Contenu de paragraphe de test Contenu de paragraphe de test Contenu de paragraphe de test Contenu de paragraphe de test Contenu de paragraphe de test</p>').append('<blockquote class="cdrInfo">cdrInfo</blockquote>');
function fTPL_Init() {
// Identification elements class cdrGlobal
$('.cdrGlobal').attr('id', function(i){ return 'cdrGlobal-' + i; });
// Identification elements contenus dans un class cdrGlobal
$('div[class^="cdr"]').not($('.cdrGlobal')).attr('id', function(i){
alert($('div[class^="cdr"]').length);
// this line is for testing code only.
// There is no bug here.
// The script run 4 times, and each time the code alert returns 4
return $(this).attr('className') + '-' + $(this).parent().attr('id').split('-')[1];
}).css('width',function(){ return '1200px'; });
$('.Colonne').attr('id', function(i){
return $(this).attr('className').split(' ')[0] + $(this).parent().attr('id').split('-')[1] + '-' + i;
})
}
});