I want to add a class for some elements in jquery, and then i want to add a new class for the elements with the new class, but it does not working.
my code:
jQuery(document).ready(function () {
jQuery('.nagyul').click(function () {
jQuery(this).removeClass('nagyul');
});
jQuery('.ajtoo').click(function () {
jQuery(this).removeClass('ajtoo');
});
jQuery('.indulas').click(function () {
jQuery('.indulas').not(this).addClass('masodik');
});
jQuery('.masodik').click(function () {
jQuery('.masodik').not(this).addClass('harmadik');
});
jQuery('.harmadik').click(function () {
jQuery('.harmadik').not(this).addClass('negyedik');
});
jQuery('.negyedik').click(function () {
jQuery('.negyedik').not(this).addClass('otodik');
});
jQuery('.otodik').click(function () {
jQuery('.otodik').not(this).addClass('hatodik');
});
jQuery('.hatodik').click(function () {
jQuery('.hatodik').not(this).addClass('hetedik');
});
jQuery('.hetedik').click(function () {
jQuery('.butorok').removeClass('butorok');
}); });
jQuery represents $, but the wordpress doesn't understand it just this way. The website is: http://www.honlapkell.hu/room/fooldal/
Every object has on the picture a class called "indulas", and my plan to remove the class "butorok" from the background picture if the user clicked on every object. So it would be colorful too.