在使用的过程中,很多时候我们想在网站的头部加上微信图标,当鼠标放到微信图标上以后显示微信二维码图片。效果如下图:
这篇wordpress教程里我们就向大家介绍一下实现的方法,原理是通过使用JS来控制DIV显示或隐藏。
1. 切换到主题目录,打开header.PHP文件,在标签之前加入以下代码:
Crayon-5c891d03330b1300037810" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">header.PHP
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-mixed-highlight" title="Contains Mixed Languages">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-language">JavaScriptCrayon-button-icon">
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">
Crayon-nums " data-settings="show"> Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;"> Crayon-num" data-line="Crayon-5c891d03330b1300037810-1">1 Crayon-num" data-line="Crayon-5c891d03330b1300037810-3">3 Crayon-num" data-line="Crayon-5c891d03330b1300037810-5">5 Crayon-num" data-line="Crayon-5c891d03330b1300037810-7">7 | Crayon-code">
Crayon-nums " data-settings="show"> Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;"> Crayon-num" data-line="Crayon-5c891d03330ba815755690-1">1 Crayon-num" data-line="Crayon-5c891d03330ba815755690-3">3 Crayon-num" data-line="Crayon-5c891d03330ba815755690-5">5 Crayon-num" data-line="Crayon-5c891d03330ba815755690-7">7 Crayon-num" data-line="Crayon-5c891d03330ba815755690-9">9 | Crayon-code">
Crayon-nums " data-settings="show"> Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;"> Crayon-num" data-line="Crayon-5c891d03330bc701236950-1">1 Crayon-num" data-line="Crayon-5c891d03330bc701236950-3">3 Crayon-num" data-line="Crayon-5c891d03330bc701236950-5">5 Crayon-num" data-line="Crayon-5c891d03330bc701236950-7">7 Crayon-num" data-line="Crayon-5c891d03330bc701236950-9">9 Crayon-num" data-line="Crayon-5c891d03330bc701236950-11">11 Crayon-num" data-line="Crayon-5c891d03330bc701236950-13">13 Crayon-num" data-line="Crayon-5c891d03330bc701236950-15">15 Crayon-num" data-line="Crayon-5c891d03330bc701236950-17">17 Crayon-num" data-line="Crayon-5c891d03330bc701236950-19">19 | Crayon-code">