28.05.2012, 11:58
(
Последний раз редактировалось Ranama; 28.05.2012 в 13:11.
)
Hello, I'm making my website for a school project. (I'm using css, JS (Jquery),Css)
And I'm trying to get it to work, I don't know that much about JS but here's the code
Here's the html code (sorry the words is in swedish xD
It won't work, can anyone help me? ^^
Thank a-lot
EDIT: Think i fixed it
And I'm trying to get it to work, I don't know that much about JS but here's the code
PHP код:
<script src="sidor/jquery-1.7.2.js/" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
var element;
if(this.click){
element = this.parentNode;
}
if((element).hasClass("expand-off")){
(element).removeClass();
(element).addClass("expand-on");
(element).slideToggle();
}
else{
(element).removeClass();
(element).addClass("expand-off");
(element).slideToggle();
}
});
});
</script>
Код:
<div id="menu"> <div class="expand-off">Om hemsidan <ol> <li><a href="sidor/vad_gor_vi.html">Vad gцr vi?</a></li> <li><a href="sidor/vilka_er_vi.html">Vilka дr vi?</a></li> </ol> </div> <div class="expand-off">Om Boklampan <ol> <li><a href="sidor/allmen_info.html">Allmдn info</a></li> <li><a href="sidor/hur_vi_fick_ideer.html">Hur vi fick idйer</a></li> </ol> </div> <div class="expand-off">Om Teknik Projektet <ol> <li><a href="sidor/material.html">Material</a></li> <li><a href="sidor/tek_vorat_projekt.html">Vеrat projekt</a></li> <li><a href="sidor/marknadsundersokning.html">Marknadsundersцkning</a></li> </ol> </div> </div>
Thank a-lot
EDIT: Think i fixed it