现在整个区域都是a=但是需要投票的点击事件并且不跳转怎么实现呢<a href="<?= Url::to(['photo', 'id' => $model->id]) ?>"> <div class="t"> <img class="photo" src="<?= Yii::getAlias('@uploadsUrl/' . $model->photo) ?>"> </div> <div class="l"> <p class="nickname">选手昵称:<?= $model->nickname ?></p> <p class="number">选手编号:<?= $model->id ?></p> </div><img class="btn-vote-s" src="<?= Asset::getAssetUrl('images/btn-vote-s.png') ?>"></a><?php$url = Url::to(['vote', 'id' => $model->id], true);$js = <<<EOF $(".btn-vote-s").on('click', function (e) { e.stopPropagation(); $.get('{$url}',function(data){ code = data.code; if (code == 200){ $(".shade-vote-success").show(); } else if(code == 304){ $('.shade-voteonly1').show(); }else if(code == 403){ }else{ } },"json"); });EOF;$this->registerJs($js);?>
添加回答
举报
0/150
提交
取消