I have a menu that links to content on the same page and through jQuery fades div's in and out, working perfectly.
The first link in the navigation has a class attached to it (current_page_item) and I would like, on click of any other link in the navigation, to remove that class and add it to the clicked link.
So far I've tried something like:
$(function() {
$("#nav-links a").click(function(){
$("#nav-links ul li").removeClass("current_page_item").find("li:last a").addClass("current_page_item");
});
});
which doesn't work.
I'm very new to javascript so any help would be appreciated.
I've been searching for a way to rotate an image a div say 90 degrees when a link is clicked, but can not seem to get it to at all. Here is some code I'm trying at the moment amongst many others, using the jQuery Rotate plugin.
$('#canvas a').click(function() {
$('#circle').rotateLeft([angle=90]);
return false;
});
Edit: I can get it to kind of work with css3, although it doesn't animate, and it only rotates once. I would like to keep rotating each time a link is clicked.
Im using the code below for a gallery, where you click on the thumbnail and the large image appears on the right hand side. It work's great, but I would like the image to fade in instead of just appear and I can't seem to find where to enter the .fadeIn().
Thanks for any help
<script type="text/javascript"> //gallery
$(document).ready(function(){
//Swap Image on Click
$("ul.thumb li a").click(function() {
var mainImage = $(this).attr("href"); //Find Image Name