A voir également:
- Comment créer une barre de recherche ?
- Créer une adresse mail - Guide
- Créer un compte gmail - Guide
- Recherche musique - Guide
- Recherche par image - Guide
- Créer un compte google - Guide
2 réponses
Templier Nocturne
Messages postés
7716
Date d'inscription
jeudi 22 janvier 2009
Statut
Membre
Dernière intervention
21 mai 2016
1 101
19 juin 2010 à 02:46
19 juin 2010 à 02:46
il te faut faire ça en JavaScript.
voilà un code à modifier qui pourait t'aider :
un deuxième :
j'espère que ces deux codes t'aideront :)
voilà un code à modifier qui pourait t'aider :
<script language="JavaScript">
var n = 0;
function findInPage(str) {
var txt, i, found;
if (str == "") return false;
if (document.layers) {
if (!window.find(str)) while(window.find(str, false, true)) n++;
else n++;
if (n == 0)
alert("Not found.");
}
if (document.all) {
txt = window.document.body.createTextRange();
for (i = 0; i <= n & (found = txt.findText(str)) != false; i++) {
txt.moveStart("character", 1);
txt.moveEnd("textedit");
}
if (found) {
txt.moveStart("character", -1);
txt.findText(str);
txt.select();
txt.scrollIntoView();
n++;
}
else {
if (n > 0) {
n = 0;
findInPage(str);
}
else
alert("Not found.");
}
}
return false;
}
</script>
<form name="search" onSubmit="return findInPage(this.string.value);">
<font size=3>
<input name="string" type="text" size=15 onChange="n = 0;">
</font>
<input type="submit" value="Find">
</form>
<p>
un deuxième :
* <SCRIPT language=JavaScript>
* /* Find In Page Script- By Mike Hall (MHall75819@aol.com) */
* /* Recherche de mot */
* var NS4 = (document.layers); // Which browser?
* var IE4 = (document.all);
* var win = window; // window to search.
* var n = 0;
* function findInPage(str) {
* var txt, i, found;
* if (str == "")
* return false;
* // Find next occurance of the given string on the page, wrap around to the
* // start of the page if necessary.
* if (NS4) {
* // Look for match starting at the current point. If not found, rewind
* // back to the first match.
* if (!win.find(str))
* while(win.find(str, false, true))
* n++;
* else
* n++;
* // If not found in either direction, give message.
* if (n == 0)
* alert("Je suis navré, je n'ai rien trouvé. Vérifiez l'orthographe.");
* }
* if (IE4) {
* txt = win.document.body.createTextRange();
* // Find the nth match from the top of the page.
* for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
* txt.moveStart("character", 1);
* txt.moveEnd("textedit");
* }
* // If found, mark it and scroll it into view.
* if (found) {
* txt.moveStart("character", -1);
* txt.findText(str);
* txt.select();
* txt.scrollIntoView();
* n++;
* }
* // Otherwise, start over at the top of the page and find first match.
*
* else {
* if (n > 0) {
* n = 0;
* findInPage(str);
* }
* // Not found anywhere, give message.
* else
* alert("Je suis navré, je n'ai rien trouvé. Vérifiez l'orthographe.");
* }
* }
* return false;
* }
* </SCRIPT>
*
* <FORM name=search onsubmit="return findInPage(this.string.value);"><INPUT
* name=string onchange="n = 0;">
* <INPUT type=submit value=Rechercher></FORM>
j'espère que ces deux codes t'aideront :)
Templier Nocturne
Messages postés
7716
Date d'inscription
jeudi 22 janvier 2009
Statut
Membre
Dernière intervention
21 mai 2016
1 101
20 juin 2010 à 16:22
20 juin 2010 à 16:22
tu veux faire si site web sans t'y connaitre en HTML & cie...
compte tenu de ce que tu veux, je crois que ça va pas être possible...
https://openclassrooms.com/fr/courses/1603881-apprenez-a-creer-votre-site-web-avec-html5-et-css3
http://www.siteduzero.com/tutoriel-3-8158-tout-sur-le-javascript.html
bon courage ;)
compte tenu de ce que tu veux, je crois que ça va pas être possible...
https://openclassrooms.com/fr/courses/1603881-apprenez-a-creer-votre-site-web-avec-html5-et-css3
http://www.siteduzero.com/tutoriel-3-8158-tout-sur-le-javascript.html
bon courage ;)
Templier Nocturne
Messages postés
7716
Date d'inscription
jeudi 22 janvier 2009
Statut
Membre
Dernière intervention
21 mai 2016
1 101
21 juin 2010 à 04:05
21 juin 2010 à 04:05
en flash ? O_o
tu peux pas faire ça en flash...
tu peux pas faire ça en flash...
Est-ce que tu pourrais me dire quoi modifier dans le code pour qu'il fonctionne sur mon site, j'ai commencé à regarder le tuto mais mon site doit être prêt dans quelques jours alors, je n'ai pas trop le temps. Si nécessaire, je peux mettre en ligne la page où je veux mettre cette barre de recherche afin que tu puisses m'aider à adapter la barre de recherche (et donc le code). Merci beaucoup.
19 juin 2010 à 18:07
19 juin 2010 à 18:29
Merci d'avance
20 juin 2010 à 02:32
20 juin 2010 à 14:00