Tag:Brother

  • 1. Find sibling elements

    Time:2021-2-16

    Making navigation display submenu with JS HTML: about skill works works1 works2 works3 Blog Blog1 Blog2 Blog3 calendar contact information other     JS: let aTages = document.getElementsByClassName(‘menutrigger’) console.log(aTages) for(let i = 0; i < aTages.length; i++){ aTages[i].onmouseenter = function(x){ console.log(‘mouseenter’) Let a = x.currenttarget // here, we don’t use x.target or atages [i] because […]

  • JavaScript encapsulation function: get the next / previous sibling node

    Time:2021-1-11

    requirement: Get the next / previous sibling element node, excluding the text node, etc Solve ie compatibility problem Code implementation: Get the next sibling element node: function getNextElement(element) { var el = element; while (el = el.nextSibling) { if (el.nodeType === 1) { return el; } } return null; } Get the last sibling element […]

  • Common methods of jquery

    Time:2020-12-14

    jQuery EQ () and get () Get(): jQuery object to DOM object. EQ (): jQuery object builds a new jQuery object.$(selector).eq( 0 ) Find element Filter (selector) reduces the scope of matching and filters in the initial jQuery object collection$(“p”).filter(“.selected, :first”) Find (selector) does not have the contents of the initial collection JQuery () to […]

  • Vue – how to introduce other components into components

    Time:2020-9-29

    Three steps of using components1: Import componentsImport a custom component name from “component path”;Note that even if the current directory is the same as the component path, it’s best to add “. Otherwise, an error will be reported2: Register componentsThe use of components requires registration. The registration method is export default { components: { The […]

  • JavaScript serialization 28 node relationship demonstration

    Time:2020-9-14

    1、 Relationship between nodes (1) Get parent node (2) Previous sibling node (3) Next sibling node (4) Gets the first child node in the tag (5) Gets the last child node in the tag (6) Gets the node of the element (7) Gets the node of any sibling Nodes include: label, attribute, text, comment, etc […]

  • One minute understanding of HTML and CSS (Le byte, Le byte Java, Le byte Architecture) 4

    Time:2020-8-23

    HTML and CSS (4) primary coverage If you want to be an excellent Java Architect, see here → Le byte free open class (Tencent class)If you need more information, please click on the right → this is a road of no return, there is a risk of baldness, please choose carefully! CSS selector In CSS, […]

  • Batch modification of Excel file xlwings in python (2)

    Time:2020-8-18

    Batch modification of excel by Python Because in the last article, I used xlrd and xlutils to modify excel. After running, the table format and pictures were all gone. My little brother was too busy and had to study it himself. xlwings In the past two days, I checked the library of Python to modify […]

  • 2020-03-05 how mongodb uses aggregation between different types of bonds

    Time:2020-8-3

    Question: mongodb join on_ id field from String to ObjectIdThere are now two sets of data: User { “_id” : ObjectId(“584aac38686860d502929b8b”), “name” : “John” } 2.Role { “_id” : ObjectId(“584aaca6686860d502929b8d”), “role” : “Admin”, “userId” : “584aac38686860d502929b8b” } I want to join these collection based on the userId (in role collection) – _id ( in user […]

  • JQuery object, basic selector, filter selector

    Time:2020-5-6

    DOM object converted to jQuery object If the parameter passed to the $(DOM) function is a DOM object, the jQuery method will wrap the DOM object into a new jQuery object <!DOCTYPE html> <html> <head> <meta http-equiv=”Content-type” content=”text/html; charset=utf-8″ /> <title></title> <script></script> </head> <body> < div > element 1 < / div > < div […]

  • On the scope of hover and its application in Vue

    Time:2020-4-19

    We used hover many times but didn’t discuss its scope carefully. This time, we used hover in the project and found that it didn’t work The reasons are:Hover has certain restrictions on the role of parent and sibling elements Let’s write some examplesI’ve defined two sibling elements here, and three children in the first element […]

  • [how much do you know about CSS – 3] how to solve the problem of overlapping margins? –BFC block level formatting context

    Time:2020-4-19

    1. Example of margin overlap Parent child element margins overlap <section id=”sec”> <style media=”screen”> #sec{ background-color: red; } .child{ height: 100px; margin-top: 10px; background: yellow; } </style> <article class=”child”></article> </section> Question:Sometimes when we set the margin top of the child element, we find that the child element does not have the effect of the top […]

  • 2020-03-05 how mongodb uses aggregation between different types of keys

    Time:2020-3-18

    Problem: mongodb join on “ID field from string to objectidThere are now two sets of data: User { “_id” : ObjectId(“584aac38686860d502929b8b”), “name” : “John” } 2.Role { “_id” : ObjectId(“584aaca6686860d502929b8d”), “role” : “Admin”, “userId” : “584aac38686860d502929b8b” } I want to join these collection based on the userId (in role collection) – _id ( in user […]