Donc, mon jQuery ne fait rien, si je le fais avec Apache ou quand je l’ouvre normalement. (Chrome)
Je l’ai lié dans le HTML, qui est connecté à mon CSS, mais ça ne fait rien. Pas tout à fait sûr si c’est parce que je ne l’ai pas lié correctement ou quelque chose. Voici tout mon code: (Question bonus: Pourquoi la liste des résultats du tournoi n’est-elle pas centrée sur la page?)
Merci beaucoup les gars!
https://stackoverflow.com/questions/15114094/jquery-not-working-with-my-html-at-all/Home.html:
Niki Stoiber
Niki Stoiber
Hey there, my name is Niki Stoiber, and this is my Webpage!
I am a 9 year old boy from Aussortinga and I want to be a professional tennisplayer someday.
https://stackoverflow.com/questions/15114094/jquery-not-working-with-my-html-at-all/AboutMe.html:
Niki Stoiber
About Me
Age: 9
Birthday: 14.4.2003
Tennis Club I play for: Better Tennis
Tournois.html:
Niki Stoiber
Tournament Results
stylesheet.css:
* { width:auto; height:auto; background-color:#D3D3D3; font-family:"Lintel", sans-serif; } @font-face { font-family: "Lintel"; src: url("./Lintel.ttf") format("truetype"); } #navbar { position:fixed; left:50%; margin-left:-254px; } ul { vertical-align:auto; list-style-type:none; position:fixed; margin:-5px; text-align:center; } .AboutMe { font-family:"Lintel", Sans-serif; } ul a li { background-color:#2F4F4F; color:#FFFFFF; border-radius:5px 5px; border:solid black; font-family:"Lintel", Sans-serif; display:inline; padding:5px; z-index:1; opacity: 0.5; } #title { z-index:2; } a:link { text-decoration:none; color:black; } a:visited { text-decoration:none; color:black; } a:focus { text-decoration:none; color:black; } a:hover { text-decoration:none; color:black; } a:activ { text-decoration:none; color:black; } h1 { text-align:center; position:relative; } p { text-align:center; position:relative; }
script.js:
$(document).ready(function() { $('a').mouseenter(function(){ $(this).fadeTo('slow', 1); }); $('a').mouseleave(function() { $(this).fadeTo('slow', 0.5) }) });
vous utilisez jQuery (la partie $) sans inclure au préalable la bibliothèque jQuery. La manière recommandée de le faire est via Google Libs
Quant à l’autre question, pourquoi vous attendiez-vous à ce que la liste soit centrée? Je ne vois aucun code pour cela.
Il semble que vous ayez oublié d’importer la bibliothèque jQuery. Ajoute ça
à l’intérieur de votre tag
CHANGEMENT
À