<html> |
<head> |
<title>test</title> |
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js'></script> |
<script src="soundmanager2.js"></script> |
|
<style type="text/css"> |
.dinamick{ |
background: url(2.png) no-repeat; |
width: 240px; |
height: 240px; |
border: 1px ridge #999999; |
margin: auto; |
} |
#dinamick{ |
position: relative; |
width: 180px; |
height: 180px; |
top: 30px; |
} |
|
/*<img src="3.png" width="200" height="200" alt="" />*/ |
</style> |
<script type="text/javascript"> |
var dv; |
function rand(m,n){m=parseInt(m);n=parseInt(n);return Math.floor(Math.random()*(n-m+1))+m;} |
|
|
|
|
$(document).ready(function(){ |
dv = $('body div.dinamick:first img#dinamick:first'); |
dP(10); |
$('button#btn').click(function(){ |
eval($('textarea#eval').val()); |
}); |
}); |
|
function dP(a){ |
a=((a>100)?100:((a<1)?1:a)); |
b=a/5; |
c=180 + b; |
b=Math.round((240-c)/2); |
dv.animate({top:b+'px',width:c+'px',height:c+'px'},10); |
setTimeout(function(){dP(rand(1,100))},rand(50,100)); |
} |
soundManager.onload = function() { |
flashVersion = 9; |
mySound = soundManager.createSound({ |
|
usePeakData: true, |
|
id: 'someSound', |
|
url: 'test.mp3', |
|
volume: 50 |
|
}); |
|
} |
|
</script> |
</head> |
<body style="width: 1000px; height: 500px;"> |
<div class="dinamick" align="center"> |
<img id="dinamick" src="3.png" alt="" /> |
|
|
</div> |
|
<a href="" onclick="mySound.setVolume(10); return false;">10%</a> |
<a href="" onclick="mySound.play(); return false;">Play</a> |
<a href="" onclick="mySound.pause(); return false;">pause</a> |
<a href="" onclick="mySound.resume(); return false;">resume</a> |
<a href="" onclick="mySound.stop(); return false;">Stop</a> |
<a href="" onclick="mySound.toggleMute(); return false;">mute</a> |
<textarea cols="60" rows="10" id="eval"></textarea> |
<button id="btn"></button> |
|
|
|
</body> |
</html> |