AU SECOURS ! (je suis prêt à me jeter par la fenêtre)

Résolu
nougitch Messages postés 431 Date d'inscription mercredi 22 octobre 2003 Statut Membre Dernière intervention 17 novembre 2008 - 2 mars 2005 à 15:50
 patrick72 - 18 juin 2014 à 13:46
Bonjour,



Je possède un tableau.

J'aimerai que quand je clique sur une donnée elle se colore.

Quand quand je reclique dessus, elle retrouve sa couleur initiale.

Et que je puisse en sélectionner plusieurs (en colorier plusieurs).

Je veux également que quand je passe au dessus d'une ligne avec la
souris, elle se colore et bien sûr, que quand je quitte la ligne
(toujours avec la souris) elle retrouve sa couleur initiale.

En sachant que mon tableau (même si ce n'est pas le cas dans l'exemple possède des couleurs alternées).



J'aimerai refaire la même chose que dans PhpMyAdmin pour ceux qui voit ce que je veux dire.




Merci mille fois à ceux qui pourront m'aider.

Plusieurs personnes m'ont donnée des éléments de réponse mais je n'arrive pas compiler le tout !



Voici ce que j'ai :

---------------------------------------------

Javascript : general.js

---------------------------------------------

function rowOverEffect(object) {

if (object.className 'dataTableRow') object.className 'dataTableRowOver';

}

function rowOutEffect(object) {

if (object.className 'dataTableRowOver') object.className 'dataTableRow';

}


---------------------------------------------
CSS : stylesheet.css

---------------------------------------------

.dataTableRow { background-color: #F0F1F1; }

.dataTableRowSelected { background-color: #ff0000; }

.dataTableRowOver { background-color: #000000; cursor: pointer; cursor: hand; }


---------------------------------------------
PHP : test.php

---------------------------------------------

<html>

<head>

<link rel="stylesheet" type="text/css" href="stylesheet.css">

<script language="javascript" src="general.js"></script>

</head>



<?

echo '';

if (isset($Je ne sais pas ce qu'il faut mettre ???)) {

echo '<tr id=\"defaultSelected\" class=\"dataTableRowSelected\"
onmouseover=\"rowOverEffect(this)\" onmouseout=\"rowOutEffect(this)\">';

}

else {

echo '----
';

}

echo 'Paris, ';

if (isset($Je ne sais pas ce qu'il faut mettre ???)) {

echo '<tr id=\"defaultSelected\" class=\"dataTableRowSelected\"
onmouseover=\"rowOverEffect(this)\" onmouseout=\"rowOutEffect(this)\">';

}

else {

echo '----
';

}

echo 'Lille, ';

if (isset($Je ne sais pas ce qu'il faut mettre ???)) {

echo '<tr id=\"defaultSelected\" class=\"dataTableRowSelected\"
onmouseover=\"rowOverEffect(this)\" onmouseout=\"rowOutEffect(this)\">';

}

else {

echo '----
';

}

echo 'Lyon, ';

echo '
';

?>



</html>

22 réponses

nougitch Messages postés 431 Date d'inscription mercredi 22 octobre 2003 Statut Membre Dernière intervention 17 novembre 2008
4 mars 2005 à 14:06
Oui, tout les fonctions de PhyMyAdmin fonctionne sous FireFox.



Mais ce n'est pas un problème, encore beaucoup de Microsofteries sur le
marché... et puis, l'essentiel fonctionne tout de même pour les autres.



Ciao !
3
ehmarc Messages postés 393 Date d'inscription mardi 2 décembre 2003 Statut Membre Dernière intervention 29 septembre 2008
2 mars 2005 à 22:23
Salut

Va voire du coter Javascript

Bon vu que tu est dans la m...

/**
* Sets/unsets the pointer and marker in browse mode
*
* @param object the table row
* @param interger the row number
* @param string the action calling this script (over, out or click)
* @param string the default background color
* @param string the color to use for mouseover
* @param string the color to use for marking a row
*
* @return boolean whether pointer is set or not
*/
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
var theCells = null;


// 1. Pointer and mark feature are disabled or the browser can't get the
// row -> exits if ((thePointerColor '' && theMarkColor '')
|| typeof(theRow.style) == 'undefined') {
return false;
}


// 2. Gets the current row and exits if the browser can't get it
if (typeof(document.getElementsByTagName) != 'undefined') {
theCells = theRow.getElementsByTagName('td');
}
else if (typeof(theRow.cells) != 'undefined') {
theCells = theRow.cells;
}
else {
return false;
}


// 3. Gets the current color...
var rowCellsCnt = theCells.length;
var domDetect = null;
var currentColor = null;
var newColor = null;
// 3.1 ... with DOM compatible browsers except Opera that does not return
// valid values with "getAttribute"
if (typeof(window.opera) == 'undefined'
&& typeof(theCells[0].getAttribute) != 'undefined') {
currentColor = theCells[0].getAttribute('bgcolor');
domDetect = true;
}
// 3.2 ... with other browsers
else {
currentColor = theCells[0].style.backgroundColor;
domDetect = false;
} // end 3


// 4. Defines the new color
// 4.1 Current color is the default one
if (currentColor == ''
|| currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
if (theAction == 'over' && thePointerColor != '') {
newColor = thePointerColor;
}
else if (theAction == 'click' && theMarkColor != '') {
newColor = theMarkColor;
marked_row[theRowNum] = true;
}
}
// 4.1.2 Current color is the pointer one
else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
&& (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
if (theAction == 'out') {
newColor = theDefaultColor;
}
else if (theAction == 'click' && theMarkColor != '') {
newColor = theMarkColor;
marked_row[theRowNum] = true;
}
}
// 4.1.3 Current color is the marker one
else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
if (theAction == 'click') {
newColor = (thePointerColor != '')
? thePointerColor
: theDefaultColor;
marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
? true
: null;
}
} // end 4


// 5. Sets the new color...
if (newColor) {
var c = null;
// 5.1 ... with DOM compatible browsers except Opera
if (domDetect) {
for (c = 0; c < rowCellsCnt; c++) {
theCells[c].setAttribute('bgcolor', newColor, 0);
} // end for
}
// 5.2 ... with other browsers
else {
for (c = 0; c < rowCellsCnt; c++) {
theCells[c].style.backgroundColor = newColor;
}
}
} // end 5


return true;
} // end of the 'setPointer()' function


C'est pas du tout le script (ironie) qu'il y a dans phpmyadmin
ensuite sur tes lignes

<tr onmouseover="setPointer(this, 0, 'over', '#DDDDDD', '#CCFFCC', '#FFCC99');" onmouseout="setPointer(this, 0, 'out', '#DDDDDD', '#CCFFCC', '#FFCC99');" onmousedown="setPointer(this, 0, 'click', '#DDDDDD', '#CCFFCC', '#FFCC99');">

<td>kjqsdjklfklhhkjdfhgljh<td>....</tr>

ver="setPointer(this, 1, 'over', '#CCCCCC', '#CCFFCC', '#FFCC99');" onmouseout="setPointer(this, 1, 'out', '#CCCCCC', '#CCFFCC', '#FFCC99');" onmousedown="setPointer(this, 1, 'click', '#CCCCCC', '#CCFFCC', '#FFCC99');">

<td>kjqsdjklfklhhkjdfhgljh<td>....</tr>

surtout tu as un chiffre (0 sur le premier et 1 sur le second) il ne faut surtout pas oublier de l'incrementer au fur et a mesure de tes ligne sinon ca va planter le reste c'est des couleurs

bon courage
++

"Aucun de nous ne sait ce que nous savons tous, ensemble."
Lao Tseu inventeur du "copier coller"
0
cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 8
3 mars 2005 à 00:34
Salut,



c'est quand même un script énorme, essaies ça :



<html>

<script type= "text/javascript">

function couleur(element)

{


if(element.style.backgroundColor=='#f0f0f0' ||
element.style.backgroundColor=='rgb(240, 240, 240)')

{

element.style.backgroundColor='#6487dc';

}

else

{

element.style.backgroundColor='#f0f0f0';

}

}

</script>

Entête 1 |Entête 2 |

----

Test, Test 2


</html>



et adapte-le en fonction des couleurs que tu souhaites ;-)



bye

<hr size ="2" width="100%">




<li>Entraide, dépannage et vulgarisation informatique: Mon site de vulgarisation informatique</li>
0
cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 8
3 mars 2005 à 00:35
je précise que rgb(240, 240, 240) et #f0f0f0 c'est pareil, c'est juste pour que firefox soit compatible avec le script...

<hr size="2" width="100%">




<li>Entraide, dépannage et vulgarisation informatique: Mon site de vulgarisation informatique</li>
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
ehmarc Messages postés 393 Date d'inscription mardi 2 décembre 2003 Statut Membre Dernière intervention 29 septembre 2008
3 mars 2005 à 01:06
salut


en meme temps jai pas essayer de reinventeer la roue ce script il est dans phpmyadmin dans le fichier function.js voili voilou....


++


"Aucun de nous ne sait ce que nous savons tous, ensemble."
Lao Tseu inventeur du "copier coller"
0
nougitch Messages postés 431 Date d'inscription mercredi 22 octobre 2003 Statut Membre Dernière intervention 17 novembre 2008
3 mars 2005 à 11:28
Bonjour et merci pour vos réponses !



J'ai essayé les deux :

--> ehmarc : je n'ai pas réussi à la faire
fonctionner. J'ai regarder dans PHPMyAdmin. En effet, la fonction est
correcte mais dans un cas concret, elle ne fonctione pas.

Peux-tu me montrer un exemple HTML qui fonctionne avec cette fonction.



--> Anthomicro : Cela fonctionne
aussi mais je n'ai pas la surbrillance avec le "onmouseover" et
surtout, le fait que mon tableau est composé de couleurs alternées.



Merci de votre aide !
0
cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 8
3 mars 2005 à 13:02
Salut,



tu peux nous passer ton code html (un petit bout), ensuite les couleurs sont alternées d'origine ?



Tu veux que la couleur change sur un onmouseover ? il aurait fallu le
faire en CSS mais bon, IE ne gère pas le hover si c'est pas pour un
lien va encore falloir faire du JS...




<hr size="2" width="100%">




<li>Entraide, dépannage et vulgarisation informatique: Mon site de vulgarisation informatique</li>
0
cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 8
3 mars 2005 à 13:04
J'aime le sujet de ce topic : "AU SECOURS ! (je suis prêt à me jeter par la fenêtre)"



LOL

<hr size="2" width="100%">




<li>Entraide, dépannage et vulgarisation informatique: Mon site de vulgarisation informatique</li>
0
nougitch Messages postés 431 Date d'inscription mercredi 22 octobre 2003 Statut Membre Dernière intervention 17 novembre 2008
3 mars 2005 à 13:21
Re Anthomicro,



C'est gentil de prendre le temps parce que là je suis sur le rebords...

Le "sujet" est super important, c'est ce qui va donner envie d'aller voir ou non :-)



Voici mon code, merci beaucoup !



Ma BDD s'appelle 'blark'



#
# Structure de la table `application`
#

CREATE TABLE application (
id_application int(8) NOT NULL auto_increment,
name_application varchar(255) NOT NULL default '',
type_application tinyint(1) NOT NULL default '0',
PRIMARY KEY (id_application)
) TYPE=MyISAM;

#
# Contenu de la table `application`
#

INSERT INTO application VALUES (9, 'Summarization', 0);
INSERT INTO application VALUES (3, 'Classification', 0);
INSERT INTO application VALUES (4, 'Indexing', 0);
INSERT INTO application VALUES (6, 'Dictation', 0);
INSERT INTO application VALUES (22, 'Document Production', 0);




Ma page s'appelle application.php



<?

include("_connexion.php");

echo "<form method='post' action='application_add.php'>

Application


Spoken language


Written language




</form>


";

if($_GET['erreur'] == 1) {

echo "
Error : you didn't enter the application's name !

";

}

elseif($_GET['erreur'] == 2) {

echo "
Error : you didn't select the application's type !

";

}

echo "

";

$request=mysql_query("SELECT * FROM application ORDER BY id_application ASC",$link);

$total=mysql_num_rows($request);

if ($total > 0) {

echo "\";

while($table=mysql_fetch_array($request,MYSQL_ASSOC)) {

$color = ($i % 2) ? \"#ffffff\" : \"#bbc3d3\" ;

$i++ ;

echo \"----
&nbsp;ID = $table[id_application],

&nbsp;$table[name_application],

";

if ($table[type_application] == 0) {

echo "
SL
, \";

}

else {

echo \"
WL
</td>\";

}

echo \",

, \";

}

echo "
";

}

else {

echo "Il n'y a pas d'enregistrements";

}

?>
0
cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 8
3 mars 2005 à 13:27
Ouch, c'est long...



remplis ton code html sans php avec un peu de texte et les couleurs
d'origine (deux lignes de cellules histoire de voir la différence, et
précise ce que tu souhaites directement stp)



par exemple : la couleur qui change quand on clique, c'est fait (voir code JS plus haut)



Tu veux également que lorsqu'on passe la souris ça change de couleur,
et lorsqu'on enlève la souris ça reprend la couleur lorsque tu avais
cliqué dessus, c'est ça ?

<hr size="2" width="100%">




<li>Entraide, dépannage et vulgarisation informatique: Mon site de vulgarisation informatique</li>
0
ehmarc Messages postés 393 Date d'inscription mardi 2 décembre 2003 Statut Membre Dernière intervention 29 septembre 2008
3 mars 2005 à 13:50
Salut

voila j'ai pas tester mais comme je l'ai deja implanter sur mon site avec succès je pense que ce petit bout de code va marcher

<script language="JavaScript" type="text/javascript">
//ici tu met le script que je t'ai mis
</script>
<?php
include("_connexion.php");
echo "<form method='post' action='application_add.php'>
Application

Spoken language

Written language

</form>

";
if($_GET['erreur'] == 1) {
echo "
Error : you didn't enter the application's name !

";
}
elseif($_GET['erreur'] == 2) {
echo "
Error : you didn't select the application's type !

";
}
echo "

";
$request=mysql_query("SELECT * FROM application ORDER BY id_application ASC",$link);
$total=mysql_num_rows($request);
if ($total > 0) {
echo "\";
while($table=mysql_fetch_array($request,MYSQL_ASSOC)) {
$color = ($i % 2) ? \"#ffffff\" : \"#bbc3d3\" ;
$i++ ;
echo \"<tr bgcolor=$color onmouseover=\\"setPointer(this, \".$i.\", 'over', '#DDDDDD', '#CCFFCC', '#FFCC99');\\"
onmouseout=\\"setPointer(this,\".$i.\", 'out', '#DDDDDD', '#CCFFCC', '#FFCC99');\\"
onmousedown=\\"setPointer(this, \".$i.\", 'click', '#DDDDDD', '#CCFFCC', '#FFCC99');\\">
&nbsp;ID = $table[id_application],
&nbsp;$table[name_application],
";
if ($table[type_application] == 0) {
echo "
SL
, \";
}
else {
echo \"
WL
</td>\";
}
echo \",
, \";
}
echo "
";
}
else {
echo "Il n'y a pas d'enregistrements";
}
?>

Bon courage
++

"Aucun de nous ne sait ce que nous savons tous, ensemble."
Lao Tseu inventeur du "copier coller"
0
nougitch Messages postés 431 Date d'inscription mercredi 22 octobre 2003 Statut Membre Dernière intervention 17 novembre 2008
3 mars 2005 à 14:22
:'-( La déprime...



J'suis désolé, soit je fais une fausse manip', soit ça marche pô !



Voilà ce que j'ai EHMARC :



<script language="JavaScript" type="text/javascript">

/**

* Sets/unsets the pointer and marker in browse mode

*

* @param object the table row

* @param interger the row number

* @param string the action calling this script (over, out or click)

* @param string the default background color

* @param string the color to use for mouseover

* @param string the color to use for marking a row

*

* @return boolean whether pointer is set or not

*/

function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)

{

var theCells = null;



// 1. Pointer and mark feature are disabled or the browser can't get the

// row -> exits

if ((thePointerColor '' && theMarkColor '')

|| typeof(theRow.style) == 'undefined') {

return false;

}



// 2. Gets the current row and exits if the browser can't get it

if (typeof(document.getElementsByTagName) != 'undefined') {

theCells = theRow.getElementsByTagName('td');

}

else if (typeof(theRow.cells) != 'undefined') {

theCells = theRow.cells;

}

else {

return false;

}



// 3. Gets the current color...

var rowCellsCnt = theCells.length;

var domDetect = null;

var currentColor = null;

var newColor = null;

// 3.1 ... with DOM compatible browsers except Opera that does not return

// valid values with "getAttribute"

if (typeof(window.opera) == 'undefined'

&& typeof(theCells[0].getAttribute) != 'undefined') {

currentColor = theCells[0].getAttribute('bgcolor');

domDetect = true;

}

// 3.2 ... with other browsers

else {

currentColor = theCells[0].style.backgroundColor;

domDetect = false;

} // end 3



// 4. Defines the new color

// 4.1 Current color is the default one

if (currentColor == ''

|| currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {

if (theAction == 'over' && thePointerColor != '') {


newColor
= thePointerColor;

}

else if (theAction == 'click' && theMarkColor != '') {


newColor
= theMarkColor;

marked_row[theRowNum] = true;

}

}

// 4.1.2 Current color is the pointer one

else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()


&& (typeof(marked_row[theRowNum]) == 'undefined' ||
!marked_row[theRowNum])) {

if (theAction == 'out') {


newColor
= theDefaultColor;

}

else if (theAction == 'click' && theMarkColor != '') {


newColor
= theMarkColor;

marked_row[theRowNum] = true;

}

}

// 4.1.3 Current color is the marker one

else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {

if (theAction == 'click') {


newColor
(thePointerColor ! '')


? thePointerColor


: theDefaultColor;


marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined'
|| !marked_row[theRowNum])


? true


: null;

}

} // end 4



// 5. Sets the new color...

if (newColor) {

var c = null;

// 5.1 ... with DOM compatible browsers except Opera

if (domDetect) {

for (c = 0; c < rowCellsCnt; c++) {


theCells[c].setAttribute('bgcolor', newColor, 0);

} // end for

}

// 5.2 ... with other browsers

else {

for (c = 0; c < rowCellsCnt; c++) {


theCells[c].style.backgroundColor = newColor;

}

}

} // end 5



return true;

} // end of the 'setPointer()' function</script>

<?php

include("_connexion.php");

echo "<form method='post' action='application_add.php'>

Application


Spoken language


Written language




</form>


";

if($_GET['erreur'] == 1) {

echo "
Error : you didn't enter the application's name !

";

}

elseif($_GET['erreur'] == 2) {

echo "
Error : you didn't select the application's type !

";

}

echo "

";

$request=mysql_query("SELECT * FROM application ORDER BY id_application ASC",$link);

$total=mysql_num_rows($request);

if ($total > 0) {

echo "\";

while($table=mysql_fetch_array($request,MYSQL_ASSOC)) {

$color = ($i % 2) ? \"#ffffff\" : \"#bbc3d3\" ;

$i++ ;

echo \"<tr bgcolor=$color onmouseover=\\"setPointer(this, \".$i.\", 'over', '#DDDDDD', '#CCFFCC', '#FFCC99');\\"

onmouseout=\\"setPointer(this,\".$i.\", 'out', '#DDDDDD', '#CCFFCC', '#FFCC99');\\"

onmousedown=\\"setPointer(this, \".$i.\", 'click', '#DDDDDD', '#CCFFCC', '#FFCC99');\\">

&nbsp;ID = $table[id_application],

&nbsp;$table[name_application],

";

if ($table[type_application] == 0) {

echo "
SL
, \";

}

else {

echo \"
WL
</td>\";

}

echo \",

, \";

}

echo "
";

}

else {

echo "Il n'y a pas d'enregistrements";

}

?>
0
nougitch Messages postés 431 Date d'inscription mercredi 22 octobre 2003 Statut Membre Dernière intervention 17 novembre 2008
3 mars 2005 à 14:35
Anthomicro,



Pour prendre un exemple plus simple :



France, Paris,

----
Royaume-Uni, Londres,

----
Espagne, Madrid




Quand je passe sur ma souris sur n'importe quel <TR>, surbrillance (en bleu par exemple).

Quand je quitte ce même <TR>, la couleur initiale est toujours là (en l'occurrence #FFFF99 ou #FF9966).



Quand je clique sur un <TR>, changement de couleur (rougle par exemple)

Si je quitte ce <TR>, il reste toujours en rouge.

En revanche, si je re-clic dessus, il retrouve sa couleur initiale (en l'occurrence #FFFF99 ou #FF9966).

En sachant que je dois pouvoir sélectionner deux <TR> (donc les mettre en rouge) en même temps, voire trois ou plus.



Merci inifniment pour votre patience...

Si ça ne marche pas... Je saute !
0
ehmarc Messages postés 393 Date d'inscription mardi 2 décembre 2003 Statut Membre Dernière intervention 29 septembre 2008
3 mars 2005 à 17:44
re:
bon ca j'ai tester j'ai simplifier au maximum :

<script language="JavaScript" type="text/javascript">
/* Sets/unsets the pointer and marker in browse mode
*
* @param object the table row
* @param integer the row number
* @param string the action calling this script (over, out or click)
* @param string the default background color
* @param string the color to use for mouseover
* @param string the color to use for marking a row
*
* @return boolean whether pointer is set or not
*/
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
var theCells = null;


// 1. Pointer and mark feature are disabled or the browser can't get the
// row -> exitsif ((thePointerColor '' && theMarkColor '')
|| typeof(theRow.style) == 'undefined') {
return false;
}


// 2. Gets the current row and exits if the browser can't get it
if (typeof(document.getElementsByTagName) != 'undefined') {
theCells = theRow.getElementsByTagName('td');
}
else if (typeof(theRow.cells) != 'undefined') {
theCells = theRow.cells;
}
else {
return false;
}


// 3. Gets the current color...
var rowCellsCnt = theCells.length;
var domDetect = null;
var currentColor = null;
var newColor = null;
var marked_row = new Array();
// 3.1 ... with DOM compatible browsers except Opera that does not return
// valid values with "getAttribute"
if (typeof(window.opera) == 'undefined'
&& typeof(theCells[0].getAttribute) != 'undefined') {
currentColor = theCells[0].getAttribute('bgcolor');
domDetect = true;
}
// 3.2 ... with other browsers
else {
currentColor = theCells[0].style.backgroundColor;
domDetect = false;
} // end 3


// 4. Defines the new color
// 4.1 Current color is the default one
if (currentColor == ''
|| currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
if (theAction == 'over' && thePointerColor != '') {
newColor = thePointerColor;
}
else if (theAction == 'click' && theMarkColor != '') {
newColor = theMarkColor;
}
}
// 4.1.2 Current color is the pointer oneelse if (currentColor thePointerColor.toLowerCase() || currentColor.toLowerCase() thePointerColor.toLowerCase()
&& (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
if (theAction == 'out') {
newColor = theDefaultColor;
}
else if (theAction == 'click' && theMarkColor != '') {
newColor = theMarkColor;
marked_row[theRowNum] = true;
}
}
// 4.1.3 Current color is the marker oneelse if (currentColor theMarkColor.toLowerCase() ||currentColor.toLowerCase() theMarkColor.toLowerCase()) {
if (theAction == 'click') {
newColor = (thePointerColor != '')
? thePointerColor
: theDefaultColor;
marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
? true
: null;
}
} // end 4


// 5. Sets the new color...
if (newColor) {
var c = null;
// 5.1 ... with DOM compatible browsers except Opera
if (domDetect) {
for (c = 0; c < rowCellsCnt; c++) {
theCells[c].setAttribute('bgcolor', newColor, 0);
} // end for
}
// 5.2 ... with other browsers
else {
for (c = 0; c < rowCellsCnt; c++) {
theCells[c].style.backgroundColor = newColor;
}
}
} // end 5


return true;
} // end of the 'setPointer()' function


</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Document sans titre</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>



<?php
$i=0;
$couleur=\"#FFFEEE\";
while($i!=200) {
$i++;
if($couleur==\"#FFFEEE\") $couleur = \"#FFFCCC\";
else $couleur = \"#FFFEEE\";
echo \"----

toto,
tata,
\";
}
?>



++

"Aucun de nous ne sait ce que nous savons tous, ensemble."
Lao Tseu inventeur du "copier coller"
0
nougitch Messages postés 431 Date d'inscription mercredi 22 octobre 2003 Statut Membre Dernière intervention 17 novembre 2008
4 mars 2005 à 10:26
Salut les gars !



EHMARC -> c'est bon, ça fonctionne mais pas dans Firefox.

Hier soir en rentrant, j'essaie et je me dis "zut, ça foire encore" !

Et là ce matin je me suis dit que j'allais quand même essayer dans IE et ça passe.

Je ne comprends pas vraiment pourquoi il ne passe pas dans Firefox
puisque PhpMyadmin dans Firefox ça marche... étrange ! Enfin...



Je te remercie, ainsi qu'Anthomicro pour avoir passé du temps pour moi.

Merci les gars !
0
ehmarc Messages postés 393 Date d'inscription mardi 2 décembre 2003 Statut Membre Dernière intervention 29 septembre 2008
4 mars 2005 à 10:31
Salut
Perso j'ai pas fait grand chose j'ai juste pomper du code de phpmyadmin...
Par contre, vu que ne connais pas du tout firefox (je developpe en interne) donc je ne pourrai pas t'aider pour une adaptation du code

Faut que je passe sur firefox chez moi histoire de le tester!!!!

++

"Aucun de nous ne sait ce que nous savons tous, ensemble."
Lao Tseu inventeur du "copier coller"
0
cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 8
4 mars 2005 à 11:39
Le code que je t'ai filé plus haut fonctionne sous firefox mais ne fait
pas tout ce que tu veux, il ne change pas la couleur au passage de la
souris

<hr size="2" width="100%">




<li>Entraide, dépannage et vulgarisation informatique: Mon site de vulgarisation informatique</li>
0
nougitch Messages postés 431 Date d'inscription mercredi 22 octobre 2003 Statut Membre Dernière intervention 17 novembre 2008
4 mars 2005 à 11:49
Yes Anthomicro,



Quel dilemme... je saute ?
0
ehmarc Messages postés 393 Date d'inscription mardi 2 décembre 2003 Statut Membre Dernière intervention 29 septembre 2008
4 mars 2005 à 11:54
Salut

Question bete : Ca marche les changements et tout le bastringue de phpmyadmin sous firefox??? si oui il doit y avoir une raison dans le code!!!!
sinon bin ..... heu .... c'est à dire que.... tu teste l'explorersous ie t'execute le mien et sous firefox celui d'antomicro (koi j'ai dit une connerie je sais pas ou)

++

"Aucun de nous ne sait ce que nous savons tous, ensemble."
Lao Tseu inventeur du "copier coller"
0
ehmarc Messages postés 393 Date d'inscription mardi 2 décembre 2003 Statut Membre Dernière intervention 29 septembre 2008
4 mars 2005 à 14:20
Bin donc si le script que je t'ai passer ne marche pas la c'est qu'il doit avoir une fonction qui traine quelques part dans phpmyadmin et qui permet de faire quelques chose de compatible ya pu qua chercher.

++

"Aucun de nous ne sait ce que nous savons tous, ensemble."
Lao Tseu inventeur du "copier coller"
0
Rejoignez-nous