Jquery (toggle & collapse) does not loop - Only work once
http://jsfiddle.net/4KUMv/
The following script shows a different background depending on the state
of the div.
When it is not expanded it shows the "plus (+)" sign, while when is
expanded it does not have background image (does not shows anything).
The problem there is that only work once.
(The .mix value makes the Div expands, and the .meta class switch to
different background).
Any clue?
Jquery Code:
$(document).ready(function() {
$('.meta').click(function() {
$(this).css('background', 'none');
});
$('.mix').click(function(){
var collapse_content_selector = $(this).attr('href');
var toggle= $(this);
$('.meta').click(function() {
$(this).css('background', 'url(images/arrow_down.png)
no-repeat scroll 95% 97% transparent');
});
$(collapse_content_selector).toggle(function(){
});
$('.meta').click(function() {
$(this).css('background', 'none');
});
});
});
Thank you!
No comments:
Post a Comment