2

addclass() プロパティを使用して可視性を切り替えずに、ホバリングしているボックスにボタンのみを表示できる方法はありますか。これを行う$(this).('.list_remove').fadeIn("200");正しい方法は何ですか?

http://jsfiddle.net/HjFPR/7/

Jクエリ

 (function(){

       $('.list_remove').hide();

      $(".boxes").hover(
      function () {
        $('.list_remove').fadeIn("200");
      },
      function () {
         $('.list_remove').fadeOut("200");
      }
    );

    })();​

HTML

<div class="boxes"> 
<input type="button" class="list_remove" value="remove"> </div>
<div class="boxes"> 
    <input type="button" class="list_remove" value="remove">
    </div>​
4

2 に答える 2

3

検索するコンテキストを指定できる$('.list_remove', this).fadeIn("200");ため.list_remove.boxes

$(".boxes").hover(
      function () {
        $('.list_remove', this).fadeIn("200");
      },
      function () {
         $('.list_remove', this).fadeOut("200");
      }
);
于 2012-12-20T06:51:27.963 に答える
2

list-removeボタンを見つけるための jQuery のコンテキストを指定することで、これを行うことができます。

$('.list_remove', this).fadeIn("200");
$('.list_remove', this).fadeOut("200");

更新されたフィドル

于 2012-12-20T06:51:53.713 に答える