Does jQuery have something like toggleSrc :-p ??
I want to change src of an image on slideToggling of a div.is there something like that give me the chance of not writing conditional statement to check the src of image to change to another src. (I am not lazy !!!)
There isn't a built-in method for this, but you could make a plugin for it, for example:
Then you'd call it like this:
...or a big safer:
You can test it out here. There are (as usual) 10 other ways to do this as well, this is just one example of how to do this and save you some code repetition.