Jump to content

[SOLVED] Jquery help


darkfreaks

Recommended Posts

If I have understood your question right it's not to hard, the following isn't an amazing solution, but a solution;

 

<!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>Animated Drop Down Menu with jQuery</title>
<link href="example_files/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="example_files/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("ul.menu_body li:even").addClass("alt");
    $('img.menu_head').click(function () {
	var ul = $(this).attr('rel');
	$('ul#' + ul).slideToggle('medium');
    });
$('ul.menu_body li a').mouseover(function () {
	$(this).animate({ fontSize: "14px", paddingLeft: "20px" }, 50 );
    });
$('ul.menu_body li a').mouseout(function () {
	$(this).animate({ fontSize: "12px", paddingLeft: "10px" }, 50 );
    });
});
</script>

</head>
<body>
<div class="container" style="float: left;">
<img src="example_files/navigate.png" rel="1" class="menu_head" width="184" height="32">
<ul style="display: none;" class="menu_body" id="1">
<li><a href="#">About Us</a></li>
<li><a href="#">Portfolio</a></li>
<li><a href="#">Clients</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">Support Forums</a></li>
<li><a href="#">Gallery</a></li>
<li><a href="#">Contact Us</a></li>
</div>
<div class="container" style="float: left;">
<img src="example_files/navigate.png" rel="2" class="menu_head" width="184" height="32">
<ul style="display: none;" class="menu_body" id="2">
<li><a href="#">About Us</a></li>
<li><a href="#">Portfolio</a></li>
<li><a href="#">Clients</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">Support Forums</a></li>
<li><a href="#">Gallery</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</div>
</body></html>

Link to comment
Share on other sites

thatis not what i mean at all :-\

 

 

i have 5 seperate images that all say different things, there image just has navigation and they use that image for all there menus.

 

i want to have 5 different menus with 5 different images.

Link to comment
Share on other sites

Jquery:

 

<script type="text/javascript">
$(document).ready(function () {
$("ul.members li:even").addClass("alt");
$('img.members_head').click(function () {
$('ul.members').slideToggle('medium');
});

$('ul.members li a').mouseover(function () {
$(this).animate({ fontSize: "14px", paddingLeft: "20px" }, 50 );

});

$('ul.members li a').mouseout.(function () {
$(this).animate({ fontSize: "12px", paddingLeft: "10px" }, 50 );
});
});
</script>

HTML:

 <td width="39" valign="top"><img src="images/nav1.gif" width="92" height="35" /></td>
      <td width="137" valign="top"><img src="images/nav2.gif" class="menu_head"> <ul class="menu_body">
  <li><a href="#">Join</a></li>
  <li><a href="#">Rules</a></li>
  <li><a href="#">Staff</a></li>
  
</ul>	  </td>
      <td width="23" valign="top"><img src="images/nav3.gif" class="members_head" /><ul class="members">
  <li><a href="#">WWCF Roster</a></li>
  <li><a href="#">Champions</a></li>
  <li><a href="#">Title History</a></li>
  <li><a href="#">Archives</a></li>
  <li><a href="#">Legends</a></li>
  <li><a href="#">Rankings</a></li>
  <li><a href="#">News</a></li>
  </ul>
  </td>

 

 

 

see my mistake?

Link to comment
Share on other sites

You are only referencing one image and one list in your jquery, try this..

 

<script type="text/javascript">
$(document).ready(function () {
$('ul.members li:even', 'ul.menu_body li:even').addClass("alt");
$('img.members_head').click(function () {
	$('ul.members').slideToggle('medium');
});

$('img.menu_head').click(function () {
	$('ul.menu_body').slideToggle('medium');
});

$('ul.members li a', 'ul.menu_body li a').mouseover(function () {
	$(this).animate({ fontSize: "14px", paddingLeft: "20px" }, 50 );
});

$('ul.members li a', 'ul.menu_body li a').mouseout.(function () {
	$(this).animate({ fontSize: "12px", paddingLeft: "10px" }, 50 );
});
});
</script>

Link to comment
Share on other sites

works now but im trying to make everything compliant according to webdev toolbar and i get this JS error

 

Error: XML filter is applied to non-XML value (function (fn) {return fn ? this.bind(name, fn) : this.trigger(name);})

Source File: file:///C:/Users/Bryce/Desktop/wwcfnew.html

Link to comment
Share on other sites

oh i installedfirebug lite on IE and get this........

"Expected identifier (wwcfnew.html,98)"

 

  <script type="text/javascript">
$(document).ready(function () {
   $('img.members_head').click(function () {
      $('ul.members').slideToggle('medium');
   });
   
   $('img.menu_head').click(function () {
      $('ul.menu_body').slideToggle('medium');
   });
    $('img.shows_head').click(function () {
      $('ul.shows').slideToggle('medium');
   });

   $('ul.ahows li a','ul.members li a', 'ul.menu_body li a').mouseover(function () {
      $(this).animate({ fontSize: "14px", paddingLeft: "20px" }, 50 );
   });

   $('ul.ahows li a','ul.members li a', 'ul.menu_body li a').mouseout.(function () {
      $(this).animate({ fontSize: "12px", paddingLeft: "10px" }, 50 );
   }); ////line 98
});
  </script>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.