Jquery 如何更改此屏幕上的背景图像

Jquery 如何更改此屏幕上的背景图像,jquery,toggle,addclass,Jquery,Toggle,Addclass,我如何才能添加这个css切换我需要一个框阴影为这个请帮助 这是我的css .play { cursor: pointer; color: #ffffff; font-family: arial; font-size: 13px; padding: 6px 24px; text-decoration: none; text-shadow: 0px 1px 0px ##6A7E8F; background-image: url(img/deactive.png); background-size:

我如何才能添加这个css切换我需要一个框阴影为这个请帮助

这是我的css

.play {
cursor: pointer;
color: #ffffff;
font-family: arial;
font-size: 13px;
padding: 6px 24px;
text-decoration: none;
text-shadow: 0px 1px 0px ##6A7E8F;
background-image: url(img/deactive.png);
background-size: auto 100%;
background-repeat: no-repeat;}
悬停

.play:hover {
background-image: url(img/hover.png);}
点击

.playing { background-image: url(img/activeall.png);}
这是我的开关

$(function () {
    $('.play').click(function (e) {
        $('.play').not(this).css('background-image', 'url(My Play Button URL)').removeClass('playing');

        if (!$(this).is('.playing')) {
            $(this).css('background-image', 'url(My Pause Button URL)').addClass('playing');
        } else {
            $(this).css('background-image', 'url(My Play Button URL)').removeClass('playing');
        }
    });
})

你在找这样的东西吗

$(function () {
$('.play').click(function (e) {
    var image = $(this).css('background-image');
if(image == 'images/pic.jpg')
    $(this).css("background-image","url(images/activeall.png)");    
else
    $(this).css("background-image","url(img/pic.jpg)"); 
});

}此代码正在运行,我希望您需要:

<html>
    <head>
        <style>
            .play {
                cursor: pointer;
                color: #ffffff;
                font-family: arial;
                font-size: 13px;
                padding: 6px 24px;
                text-decoration: none;
                text-shadow: 0px 1px 0px ##6A7E8F;
                background-image: url(https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSWvDz2JoBXPh3UjqHtJDWmwxDbpQUhP9ALCnWKzYOcqS9U6FNIbw);
                background-size: auto 100%;
                background-repeat: no-repeat;
                width:300px;
                height:300px;
                background-color:red;
            }
        </style>

        <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
        <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    </head>
    <body>
        http://stackoverflow.com/questions/20401901/how-to-change-background-image-on-this

        <div class="play"></div>

        <script>
            $(function () {
                $('.play').click(function (e) {             
                    if (!$(this).is('.playing')) {
                        $(this).css('background-image', 'url(https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcSc2qM3gE8TizDQVCM7yTcF6TMOY_YD_yzlmGjVAfBGJCtCxTli)').addClass('playing');
                    } else {
                        $(this).css("background-image", "url(https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSWvDz2JoBXPh3UjqHtJDWmwxDbpQUhP9ALCnWKzYOcqS9U6FNIbw)").removeClass('playing');
                    }
                });
            })
        </script>
    </body>
</html>
如果$这个.有一个班级在“玩”{。。