长按图片图片实现图片的缩小,并且会弹出四个分区,将图片可以选择投放进这四个区域的数据库,实现分类。可以累积数据。
...怎么发代码来着
<script src='jquery-latest.min.js'></script>
<body>
<table align=center>
<tr>
<td valign=middle align=center style="width:500px;height:500px; border:1px solid red;">
<img src='2.png' style="width:500px; height:500px;">
</td>
</tr>
<tr><td>
<button>分区1</button>
<button>分区2</button>
<button>分区3</button>
<button>分区4</button>
</td></tr>
</table>
</body>
<script>
function hide_button()
{
$('button').hide();
}
function show_button()
{
$('button').show();
}
function reset()
{
$('img').stop().animate({height: '500px', width:'500px'}, 200);
}
$( 'button' ).click( function()
{
$.ajax({
url:'/xxx.asp',
type: 'POST',
async: true,
dataType: 'json',
data: 'fenlei=' + $(this).text(),
timeout: 60000 * 5,
error: function(){
},
success: function( e )
{
}
});
hide_button();
reset();
});
$('img').mouseup( function(){
if( $('button').is(':hidden') == false )
{
return;
}
reset();
});
$('img').mousedown( function(){
$(this).animate({height: '400px', width:'400px'}, 2000, function(){
show_button();
})
});
hide_button();
</script>