0

スライドショーとして機能するtgis jクエリスクリプトを作成しようとしています.picリストを生成します

  • phpリストでは、liアイテムをクリックすると左に垂直のままで、大きくなり、クリックした同じ場所に移動します

    今では、li アイテムを大きくするだけです。追加/調整に必要なもの

    $(document).ready(function(){
    
    $("div#dynamiclist_product table tr td img#thumb").click(function(){
    $("div#dynamiclist_product table  tr td  img#main_pic").hide(); //hide prev pic that is loded automaticaly on product page
    // enlarge when clicked
    $(this).css("height","700");
    $(this).css("width","500");
    $(this).css("margin-top","170");//dont seem to work
    $(this).css("margin-left","170");//dont seem to work
    
    });});
    
    //shrink back when other is clicked
    $("img#thumb").click(function(){
    $("img#thumb").css("height","160");
    $("img#thumb").css("width","120");
    $("img#thumb").css("margin-left","0");
    $("img#thumb").css("margin-top","0");
    });
    
  • 4

    1 に答える 1

    1

    確かではありませんが、マージン宣言に「px」を追加する必要があります。それ以外の

    $(this).css("margin-top","170")
    

    行う

    $(this).css("margin-top","170px")
    

    多分それがシフトしない理由です、時々あなたは!importantタグでさえ試すことができます、多分それは他のCSSクラスによって上書きされました.

    アップデート

    <div id="wrapper">
        <div id="thumbnails" style="float:left;">
            <ul>
                <li><img src="...." /></li>
                <li><img src="...." /></li>
                <li><img src="...." /></li>
                //....
            </ul>
        </div>
        <div id="big pic">
            <p><img src="...:" /></p>
        </div>
    </div>
    

    多分このようなもの。大きなもののimg srcをjqueryに置き換えます。

    于 2013-10-10T11:13:22.020 に答える