2 scripts que je ne retrouve plus - Programmation
Marsh Posté le 18-06-2002 à 23:12:57
désolé l'ajout en favoris j'ai fais
mais le moteur de recherche ??
Marsh Posté le 18-06-2002 à 23:20:52
désolé, j'ai trouvé la solution à mes deux questions
pourtant je cherchais depuis un temps !!
les modos, si vous pouvez nettoyer mon topic, merci
Marsh Posté le 18-06-2002 à 23:26:39
si tu pouvais dire aussi la solution de ton problème, ca serait la moindre des politesses...
Marsh Posté le 19-06-2002 à 00:01:03
oui en effet j'y ai pensé mais j'ai vraiment cru que ce serait effacé aussitôt , et tu sais tu pourrais te modérer dans tes propos " ce serait la moindre des politesses" ????
tu me diras pk, t'aurais je fais chier avec ma question au point que pr me faire pardonner, je suis obligé d'avoir la réponse...
donc voilà comment j'ai fais ::
pour les favoris
<img src="mail.gif" width="24" height="24" border="0"> pr l'icône des favoris
et voilà le script en dessous ::
<script language="JavaScript">
/* Find In Page Script- By Mike Hall (MHall75819@aol.com) */
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("Not found." );
}
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("Not found." );
}
}
return false;
}
</script>
et pour le form //le moteur de recherche
<form name="search" onSubmit="return findInPage(this.string.value);">
<input name="string" type="text" size=20 onChange="n = 0;">
<input type="submit" value="Ok">
</form></td>
avec le script
<script language="JavaScript">
/* Find In Page Script- By Mike Hall (MHall75819@aol.com) */
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("Not found." );
}
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("Not found." );
}
}
return false;
}
</script>
voilà voilou, je sais pas si ça claque , mais en tout cas ça marche
Marsh Posté le 20-06-2002 à 01:18:14
Tu peux virer ton topic toi-même en éditant ton premier post !
Marsh Posté le 18-06-2002 à 22:57:35
comme je ne sais pas programmer en html
je me sert des script déjà éditer sur le ouaib et mis à notre dispo, il y a en a certain que j'avais déjà trouvé mais que maintenant je ne retrouve plus....
qq1 pourrait il me dire comment je fais pour proposer mon site en favoris mais via une petite icônes Favoris, et comment incoporés un petit moteur de recherche sur une page, un genre Ctrl + F
merci à tous, en espérant ne pas avoir poster un peu trop tard
---------------
<3 lili - http://realkoala.labrute.fr Venez me défier !!