problem with slidetoggle
problem with slidetoggle
In this website i try to use a navigation with a pulldown menu. Unfortunately i'm totally new to using js and i have no idea how to solve problems like this. May can you help me with either giving me instructions about how to solve problems generally or/and solving the given problem for me? Thanks
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Unbenanntes Dokument</title>
- <script src="jquery-1.8.0.min.js"></script>
- <script src="my_jquery_src.js"></script>
- <link href="CSS/Vorlage.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <!--Äußerer Rahmen-->
- <div id="wrap">
- <!--Navigationsleiste-->
- <div id="navigation">
- <!--Home-->
- <a href="">
- <div id="home" >
- <h1>Home</h1>
- </div>
- </a>
- <!--Allgemeines-->
- <div id="pulldown">
- <a href="">
- <div id="allgemeines">
- <h1>Home</h1>
- </div>
- </a>
- <div id=menu>
- <div></div>
- <div></div>
- <div></div>
- <div></div>
- <div></div>
- <div id="last"></div>
- </div>
- </div>
- $(document).ready(function(){
- $("#allgemeines").click(function(){
- $("#menu").slidetoggle("slow");
- });
- });
- @charset "utf-8";
- html {
- margin: 0;
- padding: 0;
- }
- body {
- margin: 0;
- padding: 0;
- text-align: center;
- color: #797979;
- font-family: Trebuchet MS, Arial, Helvetica, sans-serif;
- font-size: 11px;
- background-color: #FFF;
- font-weight: normal;
- }
- #wrap {
- width: 930px;
- margin-top: 50px;
- margin-right: auto;
- margin-bottom: 0;
- margin-left: auto;
- top: 0px;
- position: relative;
- }
- #navigation{
- width: 930px;
- height: 30px;
- background-image:url(../JPGs/Navi.jpg);
- z-index:1;
- }
- #home{
- margin-left:10px;
- }
- #home , #about_us , #contact , #newsletter , #agb , #impressum , #pulldown{
- width: 130px;
- height: 30px;
- background-image: url(../JPGs/NaviBtn.jpg);
- float:left;
- }
- #menu{
- display:none
- }
- #wrap #navigation #pulldown div {
- height: 30px;
- width: 130px;
- }
- #wrap #navigation #menu div{
- background-color:#ffe600;
- }
- #wrap #navigation #menu #last{
- background-image:url(../JPGs/NaviBtnLast.jpg);
- }
- #wrap #navigation #menu #last:hover , #wrap #navigation #menu #last:active{
- background-image:url(../JPGs/NaviBtnLastActive.jpg);
- }
- #home:hover , #allgemeines:hover , #about_us:hover , #contact:hover , #newsletter:hover , #agb:hover , #impressum:hover , #home:active , #allgemeines:active , #about_us:active , #contact:active , #newsletter:active , #agb:active , #impressum:active{
- background-image:url(../JPGs/NaviBtnActive.jpg);
- }
- #wrap #navigation #menu div:active , #wrap #navigation #menu div:hover {
- background-image:url(../JPGs/NaviBtn.jpg);
- }
- #home:hover h1 , #pulldown #allgemeines:hover h1 , #about_us:hover h1 , #contact:hover h1 , #newsletter:hover h1 , #agb:hover h1 , #impressum:hover h1 , #wrap #navigation #pulldown div:hover , #home:active h1 , #allgemeines:active h1 , #about_us:active h1 , #contact:active h1 , #newsletter:active h1 , #agb:active h1 , #impressum:active h1 , #wrap #navigation #pulldown div:active h1{
- color:#000099;
- }
- #home h1 , #allgemeines h1 , #about_us h1 , #contact h1 , #newsletter h1 , #agb h1 , #impressum h1 , #wrap #navigation #menu div h1 {
- font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
- font-size: 18px;
- text-decoration: underline;
- position: absolute;
- top: 4px;
- }
- #home h1{
- left: 51px;
- }
- #allgemeines h1{
- left: 181px;
- }
- #about_us h1{
- left: 298px;
- }
- #contact h1{
- left: 432px;
- }
- #newsletter h1{
- left: 550px;
- }
- #agb h1{
- left: 707px;
- }
- #impressum h1{
- left: 811px;
- }
- #changing_pictures{
- width:930px;
- height:500px;
- position:absolute;
- top:900px;
- left:0px;
- z-index:0;
- }
- a {
- color: #797979;
- text-decoration: none;
- }
- h1 {
- color: #858585;
- font-size: 22px;
- font-style: italic;
- font-weight: bolder;
- margin-top: 0px;
- margin-right: 20px;
- margin-bottom: 0px;
- margin-left: 0px;
- float: right;
- font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
- }
- h1:first-letter {
- margin-left: 0px;
- }
- h2 {
- font-size: 16px;
- font-weight: bold;
- margin-top: 0px;
- margin-right: 0px;
- margin-bottom: 5px;
- margin-left: 0px;
- }
- h3 {
- font-size: 12px;
- font-weight: bold;
- padding: 0px;
- margin-top: 5px;
- margin-right: 0px;
- margin-bottom: 5px;
- margin-left: 0px;
- }
- img {
- border-top-style: none;
- border-right-style: none;
- border-bottom-style: none;
- border-left-style: none;
- }
- p {
- margin-top: 5px;
- margin-right: 0px;
- margin-bottom: 5px;
- margin-left: 0px;
- font-weight: normal;
- }
- strong {
- font-weight: bold;
- }
- ul {
- margin-top: 3px;
- margin-bottom: 3px;
- padding-left: 50px;
- }