<script type="text/javascript">
var sticker_tag= function tag(obj){
return(obj.id);
}
function status(v) {
$('.status').hide();
$('.status_'+v).show();
}
var barWidth = 0; $(function(){ barWidth = ($('.bar').width()-$('.loading_l').width()); $('.download').click(function(){ status('2'); hash.callback('download', sticker_tag); }); $('.cancel').click(function(){ status('1'); hash.callback('cancel', 'yes'); }); hash.register('progress', function(value){ status('2'); var pc = parseInt(value); pc = pc < 0 ? 0 : (pc > 100 ? 100 : pc); if(pc==100) { $('.progress').css('width', barWidth); setTimeout("status('3')", 500); } else { $('.progress').css('width', Math.ceil(barWidth*pc/100)); } }); hash.register('status', status); $('.status_<?php echo $status==1 ? '1' : '4';?>').show(); }); </script>
<a class="download" onclick="javascript:tag(this)" id="<?php echo $s['tag']?>" >下載</a>
怎么让sticker_tag获取到onclick提交的值
a标签中把onclick去掉
sticker_tag换成this.id