私は、このHTML行があります。jQueryはクリック時に元のタイトルのテキストを変更しますか?
<div class="hide-btn top tip-s" original-title="Close sidebar"></div>
を、ユーザーがそれをクリックしたとき、私は「オープンサイドバー」に、テキストの変更がどのように私はこれを行うことができますことをしたいですか?
これは私のJSです:
$(".hide-btn").click(function(){
if($("#left").css("width") == "0px"){
$("#left").animate({width:"230px"}, 500);
$("#right").animate({marginLeft:"250px"}, 500);
$("#wrapper, #container").animate({backgroundPosition:"0 0"}, 500);
$(".hide-btn.top, .hide-btn.center, .hide-btn.bottom").animate({left: "223px"}, 500, function() { $(window).trigger("resize");});
}
else{
$("#left").animate({width:"0px"}, 500);
$("#right").animate({marginLeft:"20px"}, 500);
$("#wrapper, #container").animate({backgroundPosition:"-230px 0px"}, 500);
$(".hide-btn.top, .hide-btn.center, .hide-btn.bottom").animate({left: "-7px"}, 500, function() { $(window).trigger("resize");});
}
});
はお時間をいただき、ありがとうございます!
[jQueryを使用して要素のタイトル属性を変更する方法](http://stackoverflow.com/questions/987967/how-to-change-an-elements-title-attribute-using-javery)..これはあなたを助けるでしょう。 –