show, hide, background image help
hello,
i'm newbie in JQ
i created a show and hide button to open and close div,
the code working perfectly on my site, but after i click on my botton i want to change the "background image"
i have 2 images, for "show" plus.png and for "hide" minus.png
the original code: works perfect:
- jQuery(document).ready(function(){
- jQuery(".slidingDiv").hide();
- jQuery(".show_hide").show();
- jQuery('.show_hide').click(function(){
- jQuery(".slidingDiv").slideToggle();
- });
- });
i add this line 9 for the code so it will show the "hide" background image "minus.png"
see below
- jQuery(document).ready(function(){
- jQuery(".slidingDiv").hide();
- jQuery(".show_hide").show();
- jQuery('.show_hide').click(function(){
- jQuery(".slidingDiv").slideToggle();
- jQuery(".show_hide").css('background-image', 'url(" /andi/images/andi_ua/icons/minus.png ")');
- });
- });
its working after i clicked on the the "
.show_hide" button, its showing the "minus.png" background image, but how can i code it to show the "show" "plus.png" if i click on the "
.show_hide" button again ?
please advice ?