master
elf 2 years ago
parent d33942e716
commit 5caac5fc6f

@ -64,62 +64,18 @@
if(!$isImg && $enquiry) { ?>
<a class="btn btn-primary btn-lg btn-enquiry" <?php echo WPCOM::url($enquiry_url);?>><?php echo $enquiry;?>
<?php } elseif ($isImg && $enquiry) { ?>
<a class="btn btn-primary btn-lg btn-enquiry" href="javascript:;">
<a class="btn btn-primary btn-lg btn-enquiry btn-enquiry-img" href="javascript:;" data-url="<?php echo $enquiry_url;?>">
<?php echo $enquiry;?>
<div class="sweep_code">
<!-- <div class="code_arrow"></div> -->
<div class="code">
<img src="<?php echo $enquiry_url; ?>" alt="">
</div>
</div>
</a>
<?php } ?>
</div>
<style>
.btn-enquiry .sweep_code {
opacity: 0;
visibility: hidden;
margin-left: -80px;
position: absolute;
top: 105px;
left: 50%;
z-index: 97;
transition: all 0.6s cubic-bezier(0.18, 0.89, 0.32, 1.28)
}
.btn-enquiry:hover .sweep_code {
opacity: 1;
visibility: visible;
top: 40px;
}
.btn-enquiry .sweep_code .code_arrow {
border-bottom: 15px solid #FFF;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
font-size: 0;
height: 0;
width: 0;
line-height: 0;
position: absolute;
top: -15px;
left: 65px
}
.btn-enquiry .sweep_code .code {
background: #FFF;
text-align: center;
box-shadow: 0 0 7px rgba(0, 0, 0, 0.4)
}
.btn-enquiry .sweep_code .code img {
max-width: 400px;
max-height: 400px
}
.btn-enquiry .sweep_code .code p {
font-size: 16px;
color: #666;
line-height: 30px
}
</style>
<script type="text/javascript">
$('.btn-enquiry-img').on('click', function() {
layer.open({
type: 1,
skin: 'layui-layer-rim', //加上边框
area: ['420px', '240px'], //宽高
content: '<img src="'+ $(this).data('url') + '" alt="">'
});
})
</script>

File diff suppressed because one or more lines are too long

@ -215,6 +215,7 @@ function wpcom_register_scripts(){
wp_register_style('font-awesome', FRAMEWORK_URI . '/assets/css/font-awesome.css', false, THEME_VERSION);
wp_register_style('remixicon', FRAMEWORK_URI . '/assets/css/remixicon-2.5.0.min.css', false, '2.5.0');
wp_register_script('wpcom-icons', FRAMEWORK_URI . '/assets/js/icons-2.7.1.js', array(), THEME_VERSION, true);
wp_register_script('layer', FRAMEWORK_URI . '/assets/js/layer.js', array(), THEME_VERSION, true);
}
if ( ! function_exists( 'wpcom_scripts' ) ) :

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save