I’ve got this function
$("a[href*=/category/movies/]").click(function() {
so.addVariable('stretching','fill');
so.write('mediaspace');
});
that I want to turn into an if…else statement.
How do I target links inside div#header_playlist_categories
and apply an else statement, if links point to other than ‘/categories/movies/’ ?
I think what you want to do is to handle all clicks on
aelements withindiv#header_playlist_categories. You then want to do one thing if the link’shrefattribute contains/category/movies/and another if it does not. If so, you can do this nicely usingdelegate():