Jquery determines the height code of the specified module container, and if the height is not enough, add an empty line on it

JS code

$(document).ready(function() {
    var Ah = $("#ishare-1").parent().innerHeight();//判断正文模块容器高度,ishare-1是我们插件模块的id,.parent().innerHeight指的是获取插件模块的父模块(正文模块)的高度
    if ( Ah <= 250 ) {//判断正文模块容器高度低于250px像素,则在插件模块前面插入几个空白的行
    $("#ishare-1").prepend("<p> </p><p> </p><p> </p>");}});

Example:

Share.js Share articles with one click

In the zblog body, because the content of the body module of some articles in the zblog is too small, the height of the body module is low, and the container of the body module uses the css element overflow: hidden;, the QR code popped up by the WeChat button of the plug-in is partially hidden by the module container, so you can use the above method to solve this problem.

As shown in the following figure:

image.png

Tag:Jquery
t like3

Link to this article:https://en.finchui.com/program/40.html

netizens commented

guess you like

hot commodity
popular articles
hot Tags
related tags
FinchUI Store Edition

Share

Copy Link
Working hours: 9:00-22:00
Saturday and Sunday: 14:00-22:00
wechat
Scan the code to add customer service WeChat