1

私はjQueryでいくつかの基本的な動きを試みてきましたが、初心者です。どうやってそれを達成しますか?

これまでの私のコードは次のとおりです。

jQuery(document).ready(function () {

    // show/hide
    jQuery('#div').hide(); //hide at the beginning

    jQuery('#hover').hover(function () {
        jQuery("#div").show(400);
        jQuery('#hover').text('-');
        jQuery('#hover').addClass('click');
        jQuery('.click').height('auto');
        jQuery('.click').width('auto');
        jQuery('.click').css("font-size", "1em");
    }), jQuery("#div").hover(function () {
        //nothing on hover over
    }, function () {
        //hide on hover out
    });
});

私のHTMLマークアップは次のとおりです。

<a id="hover" href="javascript:;">Hide</a>
<div id="div">test</div>

私はやり方が間違っていると感じました。手伝って頂けますか?

4

2 に答える 2