• Vue monitors whether the DOM element scrolls up or down in demo to achieve ceiling effect.


    Go directly to the page dmeo <template> <div> <van-pull-refresh v-model=”isLoading” @refresh=”onRefresh” > <ul ref=”msgList”> <li>11111111</li> <li>11111111</li> <li>11111111</li> <li>11111111</li> <li>11111111</li> <li>11111111</li> <li>11111111</li> <li>11111111</li> <li>11111111</li> <li>11111111</li> <li>11111111</li> <li>11111111</li> <li>11111111</li> <li>11111111</li> <li>11111111</li> <li>11111111</li> <li>11111111</li> </ul> </van-pull-refresh> </div> </template> <script> //I use the vant component globally here, so I can use the drop-down effect directly //Van pull refresh export […]

  • Using “uitableview adaptive content height” with masonry and fdtemplatelayoutcell


    1、 Preparation 1.FDTemplateLayoutCell Automatic calculation of uitableviewcell height produced by sunny DashenFDTemplateLayoutCell_ download 2.Masonry The most popular AutoLayout framework is lightweightMasonry_ download After downloading the above two third parties (or using cocoapods), import them into the project, and then create the required files 2、 Custom uitableview Mytableviewcell. H creates a model property to pass values […]

  • Font structure and text vertical center scheme


    Image source:https://unsplash.com/photos/G…Author: Feng Hao 1. Introduction Vertical center is basically a problem that must be mastered by beginners of CSS. We must have seen “CSS vertical center n” in various tutorials Generally speaking, these methods can meet all kinds of use scenarios. However, when we encounter the situation that we need to use some special […]

  • CSS sets the div height to 100% all the time


    preface Sometimes you need to keep the height of a box container 100% at all times, and the browser height remains the same no matter how you zoom. It’s like the sidebar of some websites, but it doesn’t work to set the height of the box container to 100%. demo If you want the percentage […]

  • Leetcode 108. Converting an ordered array into a binary search tree | Python


    108. Convert the ordered array to binary search tree subject An ordered array arranged in ascending order is transformed into a highly balanced binary search tree. In this problem, a height balanced binary tree means that the absolute value of the height difference between the left and right subtrees of each node of a binary […]

  • Elastic box flex box scroll bar principle, to avoid being stretched, never failure


    In HTML, to scroll the region content, you only need to set the width and height of the element, and then set the CSS property overflow to auto or scroll     In the flex box layout, sometimes the width and height of our content are variable and cannot be determined. At this time, setting […]

  • Pure CSS realizes the adjustment of div height according to the adaptive width (percentage)


    In today’s responsive layout requirements, many elements that can automatically adjust the size can achieve height and width adaptation, such as img{ width:50%;height : Auto;} to adjust the height of the picture according to the width ratio. However, div, the most used tag, can’t be adjusted automatically (either inherited from the parent, or specified Px, […]

  • CSS – two column layout


    Two column layout (one side fixed width, one side adaptive), should be used frequently in work, can be said to be the front-end foundation. In an interview, however, interviewer: write down all the ways you can think of two column layout on paper. I thought: it’s not easy. Think about it… Suddenly! Don’t say much, […]

  • JQ implementation waterfall flow layout + lazy loading


    Example: Thinking: 1. Make sure that all the pictures are the same width, and then determine how many columns to show, the first row to use float:left Implement sorting2. As shown in the figure below, we show a total of four columns of pictures. Starting from the second row, we put the pictures in the […]

  • CSS usage record: function and difference of height, line height and font size


    About CSS block model:CSS block model What is line height? As shown in the figure above, the base line is not the lower edge of the Chinese characters, but the lower end of the English letter “X”. Line height: as shown in the figure, the height between the two red lines and between the upper […]

  • [jQuery] judge the expansion of multiple lines according to the height


    Multiline expansion Introduction more box is a div that determines whether to add an expansion arrow based on the height This is the icon of Ali font library (can be ignored) <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> <title>Document</title> <style> .cor-introduce{ line-height: 24px; color: #999; position: relative; overflow: hidden; } .introduce-more-box{ text-align: right; } .intro-more{ […]

  • Data structure and search set


    And check the collection And search set is considered to be one of the most concise and elegant data structures, mainly used to solve some problemsElement groupingIt’s a matter of time. It manages a series ofdisjoint set And supports two operations: mergeUnion: merge two disjoint sets into one set. query(find): query whether two elements are […]