jquery toggle with buttons two images?

有些话、适合烂在心里 提交于 2019-12-04 20:46:36

Have a look at this Tutorial - jQuery Image Swap Using Click - This may be what you are trying to achieve. Let us know how you get on.

I'm not really sure this is wat you mean but: You could use the Id's of the buttons

togglebtn.click(function(){
            var btn = this;
        $('.togglecontainer').toggle(500, function(){
            var txt = $(btn).html();
            $(btn).html((txt == 'Show less') ? 'Show more' : 'Show less');
            $("#btn2_Id").html((txt == 'Show less') ? '<img src="http://yourdomain.com/images/hide.png"/>' : '<img src="http://yourdomain.com/images/show.png"/>');
        });
});
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!