Authored by whb

h5的show

... ... @@ -70,12 +70,12 @@ define('mobile', function(require, exports) {
exports.show = function(){
$(".layout-item").bind("tap",function(event)
{
var imageWidth = 320, imageHeight = 320;
var imageWidth = 360, imageHeight = 360;
$(this).find(".image-box .pic-tip").each(function() {
var style_top = parseInt($(this).attr("x")) / 10000 * imageHeight;
var style_left = parseInt($(this).attr("y")) / 10000 * imageWidth;
$(this).css({top:style_top, left:style_left});
$(this).css({top:style_top, left:style_left, display:"block"});
});
});
};
});
\ No newline at end of file
});
... ...
... ... @@ -8,10 +8,13 @@
<div class="image-box">
<a href="javascript:;">
<img data-original="<?php echo str_replace('_','_-0320x0320-primary', $fragment['image']);?>"
src="<?php echo preg_replace('/_\.(\w+)/i','', $fragment['image']);?>?imageMogr2/thumbnail/320x320/strip/quality/80" alt="" style="height: 320px;width:320px;">
src="<?php echo preg_replace('/_\.(\w+)/i','', $fragment['image']);?>?imageMogr2/thumbnail/320x320/strip/quality/80" alt="">
</a>
<?php foreach($fragment['labelList'] as $label):?>
<a class="pic-tip" href="javascript:;" x="<?php echo $label['x']?>" y="<?php echo $label['y']?>"><?php echo $label['brandName'].$label['categoryName'];?></a>
<a class="pic-tip" href="javascript:;" x="<?php echo $label['x']?>"
y="<?php echo $label['y']?>" style="display:none;">
<?php echo $label['brandName'].$label['categoryName'];?>
</a>
<?php endforeach;?>
</div>
<div class="content">
... ... @@ -37,4 +40,4 @@
mobile.show();
})
</script>
<?php $this->_endblock();?>
\ No newline at end of file
<?php $this->_endblock();?>
... ...