content slider won't move?
I'm having trouble getting the following to work. I need to move everything by -450px multiplied by the index number of each link. So far the index part works, but the animate doesn't. I'm pretty sure there's a simple solution, I just can't find it :(
jQuery:
- (function($) {
- //click on #submenu moves #content
- $.fn.subnav = function(){
- var $object = $(this);
- $("#subnav a").click(function () {
- //when #subnav is clicked, move
- var index = $("#subnav a").index(this);
- var $move = index * -450;
- $("#content")({"top": -450 + "px"}, 500);
- $("span").text("That was div index #" + index);});
- }
- })( jQuery );
This is the HTML, it's not complete, but i think it's enough to get an idea of what i'm doing
<div id="content">
<ul id="slider">
<li>
<video controls width="640" height="360">
<source src="../video/video.mp4" type="video/mp4">
<source src="../video/video.ogv" type="video/ogg">
<source src="../video/video.webm" type="video/webm">
</video>
<h1><span></span></h1>
</li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>