Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在jquery代码中调用脚本_Javascript_Jquery - Fatal编程技术网

Javascript 在jquery代码中调用脚本

Javascript 在jquery代码中调用脚本,javascript,jquery,Javascript,Jquery,下面的代码应该在更改切换容器时触发,这些容器显示调整大小的文本以适合于一个框 <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script src="http://jquery-textfill.github.io/jquery-textfill/jquery.textfill.min.js"></scrip

下面的代码应该在更改切换容器时触发,这些容器显示调整大小的文本以适合于一个框

<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://jquery-textfill.github.io/jquery-textfill/jquery.textfill.min.js"></script>

<script>
$(function(){
  $(".clsNumber").textfill();
});
</script>

<script>
$(document).ready(function(){
  $("button").click(function(){
    $(".clsToggle").slideToggle();
  });
});
</script>
</head>

<body>
  <div class="clsToggle">
    <div class="clsNumber" style="width:100px; height:50px; background-color:red;">
      <span>One</span>
    </div>
  </div>
  <div class="clsToggle" style="display:none;">
    <div class="clsNumber" style="width:100px; height:50px; background-color:green;">
      <span>Two</span>
    </div>
  </div>
  <button>click me</button>
</body>

$(函数(){
$(“.clsNumber”).textfill();
});
$(文档).ready(函数(){
$(“按钮”)。单击(函数(){
$(“.clsToggle”).slideToggle();
});
});
一个
两个
点击我
我希望调整大小的文本将适用于两个切换容器


隐藏框(
display:none;
)忽略其他脚本(jQuery TextFill)的任何原因?

使用以下命令更改document.ready代码

$(document).ready(function(){
  $("button").click(function(){
    $(".clsToggle").slideToggle();
     $(".clsNumber").textfill();
  });
});
请找到完整的代码