ok... so, i just started Jquery a couple days ago. The whole syntax of everything is confusing.
Im trying to build a simple portfolio viewer and cant seem to get anything to work right. I had one of my web teachers help me, but, similar to a problem I have with this site, I dont understand alot of the allowed syntax that can be placed in each function and what not...
Anyway! the code that he helped me build in the 15 minutes he had free didnt quite work and I am eager to continue working on my site, problem is I havent a clue what he was doing so I dont quite know where to begin.
here is my code...
- $('document').ready(function() {
$('.port_element_content > div').click(function() {
var c = $(this).attr('class');
var d = $('.viewer div').attr('class', c);
var e = $('.viewer div').attr('class', 'vis');
if (e == false) {
d.show('slow');
} else if (d == e) {
e.hide('slow');
} else {
e.hide('slow');
d.show('slow');
d.addClass('vis');
}
});
});
Whats happening is each time I click a thumbnail, all my images display, block, when I only want the one I click on to show up. He was explaining to me that the .attr function simply returns a boolean true or false and therefore isnt the right code. And he was unsure with out scanning the documentation for the proper funtcion to use. like I said before a click on any thumb shows all the images at once...
Does this make any sense? Can anyone help? Let me know if you need more context!
Thanks All