Problème avec fond dépendant du N° de Forum
4 participants
Forum gratuit : Le forum des forums actifs :: Entraide & Support... :: Problème avec un script, un code :: Archives des problèmes avec un code
Page 1 sur 1 • Partagez
Problème avec fond dépendant du N° de Forum
Bonjour!
J'ai récemment installé le script ci-dessous...
J'ai récemment installé le script ci-dessous...
- Code:
var id_forum;
var bg_forum;
function BackgroundForum(id_forum,bg_forum){
this.id_forum = id_forum;
this.bg_forum = bg_forum;
}
var tableau_background_id = new Array();
tableau_background_id[0] = new BackgroundForum("21","http://img11.hostingpics.net/pics/397728IzzyRaitoBaraque.jpg");
tableau_background_id[1] = new BackgroundForum("178","http://img11.hostingpics.net/pics/308528FondZune03.jpg");
tableau_background_id[2] = new BackgroundForum("176","http://img11.hostingpics.net/pics/788164OniFond.jpg");
tableau_background_id[3] = new BackgroundForum("121","http://img11.hostingpics.net/pics/596658CinqFlches.jpg");
tableau_background_id[4] = new BackgroundForum("204","http://img11.hostingpics.net/pics/200927Hemato.jpg");
tableau_background_id[5] = new BackgroundForum("183","http://img11.hostingpics.net/pics/308528FondZune03.jpg");
tableau_background_id[6] = new BackgroundForum("180","http://img11.hostingpics.net/pics/308528FondZune03.jpg");
tableau_background_id[7] = new BackgroundForum("144","http://img11.hostingpics.net/pics/436625RebellesFond.jpg");
tableau_background_id[8] = new BackgroundForum("151","http://img11.hostingpics.net/pics/436625RebellesFond.jpg");
tableau_background_id[9] = new BackgroundForum("147","http://img11.hostingpics.net/pics/436625RebellesFond.jpg");
tableau_background_id[10] = new BackgroundForum("148","http://img11.hostingpics.net/pics/436625RebellesFond.jpg");
tableau_background_id[11] = new BackgroundForum("149","http://img11.hostingpics.net/pics/436625RebellesFond.jpg");
tableau_background_id[12] = new BackgroundForum("150","http://img11.hostingpics.net/pics/436625RebellesFond.jpg");
tableau_background_id[13] = new BackgroundForum("166","http://img11.hostingpics.net/pics/194716MilitaryFond.jpg");
tableau_background_id[14] = new BackgroundForum("15","http://img11.hostingpics.net/pics/522804MandresFonds.jpg");
tableau_background_id[15] = new BackgroundForum("16","http://img11.hostingpics.net/pics/144729MemoryFOND.jpg");
tableau_background_id[16] = new BackgroundForum("14","http://img11.hostingpics.net/pics/315248TheHeartFond.jpg");
tableau_background_id[17] = new BackgroundForum("179","http://img11.hostingpics.net/pics/308528FondZune03.jpg");
tableau_background_id[18] = new BackgroundForum("181","http://img11.hostingpics.net/pics/308528FondZune03.jpg");
tableau_background_id[19] = new BackgroundForum("182","http://img11.hostingpics.net/pics/308528FondZune03.jpg");
tableau_background_id[20] = new BackgroundForum("225","http://img11.hostingpics.net/pics/708301SlaveMarket.jpg");
tableau_background_id[21] = new BackgroundForum("175","http://img4.hostingpics.net/pics/326466Bibliotheque.png");
tableau_background_id[22] = new BackgroundForum("28","http://img11.hostingpics.net/pics/397728IzzyRaitoBaraque.jpg");
tableau_background_id[23] = new BackgroundForum("27","http://img11.hostingpics.net/pics/397728IzzyRaitoBaraque.jpg");
tableau_background_id[24] = new BackgroundForum("26","http://img11.hostingpics.net/pics/397728IzzyRaitoBaraque.jpg");
tableau_background_id[25] = new BackgroundForum("22","http://img11.hostingpics.net/pics/397728IzzyRaitoBaraque.jpg");
tableau_background_id[26] = new BackgroundForum("224","http://img4.hostingpics.net/pics/411356Appartement.png");
tableau_background_id[27] = new BackgroundForum("159","http://img4.hostingpics.net/pics/411356Appartement.png");
function findBackgroundByURL(url){
for(i=0;i<tableau_background_id.length;i++){
if(url.search("f"+tableau_background_id[i].id_forum) != -1){
return tableau_background_id[i];
}
if($("a.nav:last").attr("href").search("f"+tableau_background_id[i].id_forum) != -1){
return tableau_background_id[i];
}
}
return null;
}
$(function(){
var background_id = findBackgroundByURL(document.URL);
if(background_id != null){
$("body").css("background-image","url("+background_id.bg_forum+")");
}
});
Dernière édition par Zuny le Ven 11 Oct 2013 - 8:31, édité 1 fois
Re: Problème avec fond dépendant du N° de Forum
-> Up
J'ai trouvée une solution provisoire (mettre les plus gros chiffres en premier) mais ça ne marche pas complétement. (en gros ça marche pour les fonds qui sont dans les lignes, mais je voudrais aussi le fond par défaut là où je n'ai rien demandé et ça, ça marche pas en mettant les plus grand nombre à la fin.) J'ai donc toujours besoin d'une correction de code. Un petit élément pour dire "tu t'arrêtes au chiffre demandé, point".
J'ai trouvée une solution provisoire (mettre les plus gros chiffres en premier) mais ça ne marche pas complétement. (en gros ça marche pour les fonds qui sont dans les lignes, mais je voudrais aussi le fond par défaut là où je n'ai rien demandé et ça, ça marche pas en mettant les plus grand nombre à la fin.) J'ai donc toujours besoin d'une correction de code. Un petit élément pour dire "tu t'arrêtes au chiffre demandé, point".
Re: Problème avec fond dépendant du N° de Forum
Bonjour Zuny,
Il y a toujours un tiret après le numéro, il s'agit de l'ajouter lors de la recherche.
Donc au lieu de rechercher «F3» utiliser plutôt «F3-»; ainsi plus de confusion avec 3, 30, 300.
Il y a toujours un tiret après le numéro, il s'agit de l'ajouter lors de la recherche.
Donc au lieu de rechercher «F3» utiliser plutôt «F3-»; ainsi plus de confusion avec 3, 30, 300.
Re: Problème avec fond dépendant du N° de Forum
Hey!
Merci beaucoup. Ça a l'air de marcher.
Sujet résolu donc
Merci beaucoup. Ça a l'air de marcher.
Sujet résolu donc
Re: Problème avec fond dépendant du N° de Forum
Bonjour, Afin de faciliter la gestion des problèmes, si votre problème est résolu, pensez à :
Vous pouvez également remercier les personnes qui vous ont aidé, en cliquant sur le bouton A bientôt sur ForumActif |
Re: Problème avec fond dépendant du N° de Forum
Juste un merci à MasDan car j'utilise aussi ce java de ZZ10 (je crois) +1
Forum gratuit : Le forum des forums actifs :: Entraide & Support... :: Problème avec un script, un code :: Archives des problèmes avec un code
Page 1 sur 1
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum