asked on
function toggleslideDown (activator, selector) {
$(activator).click(function(){
$(this).prev('section').find(selector).slideDown();
$(this).find('span').text("Less");
$(this).children('img').attr('src', 'img/up-arrow.png');
});
}
function toggleslideDown(activator, selector) {
$(activator).click(function(){
var text = $(this).find('span').text();
var b = text == "Less";
$(this).find('span').text(b?"More":"Less");
if(b) $(this).prev('section').find(selector).slideDown(); else $(this).prev('section').find(selector).slideUp();
$(this).children('img').attr('src', b:'img/down-arrow.png'?'img/up-arrow.png');
});
}
ASKER
$(this).children('img').attr('src', b:'img/down-arrow.png'?'img/up-arrow.png');
jQuery (Core) is a cross-browser JavaScript library that provides abstractions for common client-side tasks such as Document Object Model (DOM) traversal, DOM manipulation, event handling, animation and Ajax. jQuery also provides a platform to create plugins that extend jQuery's capabilities beyond those already provided by the library.
TRUSTED BY
http://jqueryui.com/accordion/
That should make it easier