<script type="text/javascript">
$(document).ready(function () { $("#products_like_yun1").click(function () {}) });
$(document).ready(function () { $("#products_like_yun2").click(function () {}) });
$(document).ready(function () { $("#products_like_yun3").click(function () {}) });
$(document).ready(function () { $("#products_like_yun4").click(function () {}) });
$(document).ready(function () { $("#products_like_yun5").click(function () {}) });
</script>

解决方案 »

  1.   

    $(document).ready(function () { $("#products_like_yun1").click();好像click()括号中应该没有东西吧 
      

  2.   


    <script type="text/javascript">
    $(document).ready(function(){
     $("#products_like_yun1").click(function(){
       //do something what you want
       alert("点击了");
     });
     $("#products_like_yun2").click(function(){
       //do something what you want
     });
     $("#products_like_yun3").click(function(){
       //do something what you want
     }); 
     $("#products_like_yun4").click(function(){
       //do something what you want
     }); 
     $("#products_like_yun2").click(function(){
       //do something what you want
     }); 
    });
    </script>
    或者你有别的 想法  你想干什么?
      

  3.   

    点击执行了啊,只是你那里是执行了一个空方法。click(function(){})
      

  4.   

    这是5个DIV  我想在单击DIV的时候能够改变被单击DIV的样式   
      

  5.   

    <script type="text/javascript">
            $(document).ready(function () { $("#products_like_yun1").click(function () { $(this).css("products_like_yun_update"); $("#products_like_yun2").css("products_like_yun_jinpin"); $("#products_like_yun3").css("products_like_yun"); $("#products_like_yun4").css("products_like_yun_baby"); $("#products_like_yun5").css("products_like_yun_shishang"); }) });
            $(document).ready(function () { $("#products_like_yun2").click(function () { $(this).css("products_like_yun_update"); $("#products_like_yun2").css("products_like_yun_jinpin0"); $("#products_like_yun3").css("products_like_yun"); $("#products_like_yun4").css("products_like_yun_baby"); $("#products_like_yun5").css("products_like_yun_shishang"); }) });
            $(document).ready(function () { $("#products_like_yun3").click(function () { $(this).css("products_like_yun_update"); $("#products_like_yun2").css("products_like_yun_jinpin"); $("#products_like_yun3").css("products_like_yun0"); $("#products_like_yun4").css("products_like_yun_baby"); $("#products_like_yun5").css("products_like_yun_shishang"); }) });
            $(document).ready(function () { $("#products_like_yun2").click(function () { $(this).css("products_like_yun_update"); $("#products_like_yun2").css("products_like_yun_jinpin"); $("#products_like_yun3").css("products_like_yun"); $("#products_like_yun4").css("products_like_yun_baby0"); $("#products_like_yun5").css("products_like_yun_shishang"); }) });
            $(document).ready(function () { $("#products_like_yun2").click(function () { $(this).css("products_like_yun_update"); $("#products_like_yun2").css("products_like_yun_jinpin"); $("#products_like_yun3").css("products_like_yun"); $("#products_like_yun4").css("products_like_yun_baby"); $("#products_like_yun5").css("products_like_yun_shishang0"); }) });
        </script>
      

  6.   

    如果不执行默认的事件,楼主可以试试$("***").click(function({return false;}))
    返回false
      

  7.   

    是不是要修改class?
    $(this).addClass("className"); 
    $(this).removeClass("className"); 
      

  8.   


    一个ready方法就ok
    不能写多个,把函数方法都写在ready方法中即可;
    添加样式用addClass
    $(document).ready(function() {
    $("#products_like_yun1").click(function() {
    $(this).addClass("products_like_yun_update");
    $("#products_like_yun2").addClass("products_like_yun_jinpin");
    $("#products_like_yun3").addClass("products_like_yun");
    $("#products_like_yun4").addClass("products_like_yun_baby");
    $("#products_like_yun5").addClass("products_like_yun_shishang");
    });
    $("#products_like_yun2").click(function() {
    $(this).addClass("products_like_yun_update");
    $("#products_like_yun2").addClass("products_like_yun_jinpin0");
    $("#products_like_yun3").addClass("products_like_yun");
    $("#products_like_yun4").addClass("products_like_yun_baby");
    $("#products_like_yun5").addClass("products_like_yun_shishang");
    });
    $("#products_like_yun3").click(function() {
    $(this).addClass("products_like_yun_update");
    $("#products_like_yun2").addClass("products_like_yun_jinpin");
    $("#products_like_yun3").addClass("products_like_yun0");
    $("#products_like_yun4").addClass("products_like_yun_baby");
    $("#products_like_yun5").addClass("products_like_yun_shishang");
    });
    $("#products_like_yun2").click(function() {
    $(this).addClass("products_like_yun_update");
    $("#products_like_yun2").addClass("products_like_yun_jinpin");
    $("#products_like_yun3").addClass("products_like_yun");
    $("#products_like_yun4").addClass("products_like_yun_baby0");
    $("#products_like_yun5").addClass("products_like_yun_shishang");
    });
    $("#products_like_yun2").click(function() {
    $(this).addClass("products_like_yun_update");
    $("#products_like_yun2").addClass("products_like_yun_jinpin");
    $("#products_like_yun3").addClass("products_like_yun");
    $("#products_like_yun4").addClass("products_like_yun_baby");
    $("#products_like_yun5").addClass("products_like_yun_shishang0");
    });
    });
      

  9.   

    我断点运行之后   当点击的时候 不执行创建单击事件的代码    只是在加载页面之前执行了一次   也就是说   加载页面的时候  JS给DIV创建了单击事件  就是点击的时候不能够执行