ببین این کمکت میکنه . مثلاهرجای برنامت که تابع بیگ باکس رو صدا بزنی . که اون باکس ااولت بززگ بشه . بعد رویدادی رخ میده که باعث میشه باکس دوم بزرگ بشه . البته شما می تونی از روش پابلیشر و سابسکرایب هم این کارو انجام بدی /
<html>
<head>
<title></title>
<style type="text/css">
div{
position: absolute;;
}
#box1{
display: inline-block;
width: 100px;
height: 20px;
float: left;
background-color:blue;
}
#box2{
display: inline-block;
width: 100px;
height: 400px;
float: left;
margin-left: 50px;
background-color: red;
}
</style>
</head>
<body>
<button id='btn'>+ Click +</button>
<div id="box1"></div>
<div id="box2"></div>
<script type="text/javascript" src="../common/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
$(function(){
$(document).on('box2',function(e){
var size=parseInt($('#box1').css('height'));
$("#box2").animate({height:size});
});
function bigBox1(rnd){
$("#box1").animate({height:rnd});
$(document).trigger('box2');
}
$("#btn").click(function(){
bigBox1();
});
setInterval(function(){
var rnd=Math.round(Math.random()*500);
bigBox1(rnd)
},1000);
});
</script>
</body>
</html>