0
http://s199881165.onlinehome.us/transfem/sortable%20test/sortable2.php

そのため、特定のビデオにリンクするドラッグ可能/ドロップ可能/ソート可能 (jquery) タイルを持つビデオ サイト UI に取り組んでいます。それらの上にマウスを置くとわかるように、それらはすべて狂っています...

何が起こるべきか、そして私がコード化しようとしていたのは、1つのボックスにマウスオーバーして、そのタイル(div)の追加/削除クラスをトリガーすることです。

誰にもアイデアはありますか?

4

2 に答える 2

0

主な理由は、scriptタグを の子として持っていることです#sortable1。このため、$( "#sortable1 li:nth-child(1)" )セレクターは目的の結果を生成していません

考えられる解決策の1つは、試してみることです

$( "#sortable1 li:eq(1)" )

より良い解決策として、次のようなものを使用することをお勧めします

$(function() {
    $( "#sortable1 > li").hover(function(){
        $(this).next().children('div').removeClass( "boxxySTILL", 200, "linear" ).addClass( "boxxy", 200, "linear" );
    }, function(){
        $(this).next().children('div').removeClass( "boxxy", 200, "linear" ).addClass( "boxxySTILL", 200, "linear" );
    });
});

liこのようなすべてのハンドラーを登録する代わりに

  $(function() {
  $( "#sortable1 li:nth-child(1)" ).mouseenter(function() {

  $( "#theone1" ).removeClass( "boxxySTILL", 200, "linear" ).addClass( "boxxy", 200, "linear" );

});

  $(function() {
  $( "#sortable1 li:nth-child(1)" ).mouseleave(function() {

    $( "#theone1"  ).removeClass( "boxxy", 200, "linear" ).addClass( "boxxySTILL", 200, "linear" );

}); 

  });
});
于 2013-04-26T00:47:13.340 に答える