Today I got familiar with the mouse zooming effect on the front end of Taobao, which is similar to the principle of using slides. I will analyze this code here. Copy code The code is as follows:<div class="sub all_t1" style="width:160px;height:107px;background:url(upload/2022/web/T2khnoXihaXXXXXXXX_!!845309971.png_160x160.jpg) no-repeat;"> <div data-widget-config="{'trigger':'.all_t1','align':{'node':'.all_t1','offset':[0,-160],'points':['bc','tc']}}" data-widget-type="Popup" class="J_TWidget hidden"> <div style="width:310px;height:207px;background:url(upload/2022/web/T2khnoXihaXXXXXXXX_!!845309971.png_310x310.jpg) no-repeat"></div> </div> </div> class="J_TWidget hidden" is the key to Taobao's built-in js code to control image attributes. It is used to obtain the node of the div and control the node. As for style, it is the definition of the style, including length, width, background image <div data-widget-config="{'trigger':'.all_t1','align':{'node':'.all_t1','offset':[0,-160],'points':['bc','tc']}}" data-widget-type="Popup" class="J_TWidget hidden"> This is undoubtedly the definition of the properties of the special effects. node: 'custom', // reference element. The popup is positioned relative to the reference element. Just like writing contacts, Supports writing of class and id selectors points: [tr,tl], // ['tl', 'tr'] means that the popup's tl is aligned with the reference node's tr. For the specific meaning and value of tl and tr, please see the screenshot below. t(top),c(center),b(bottom),l(left),r(right) offset: [0,0] // Valid value is [n, m], after points are aligned, offset value, Generally, it can be used for fine-tuning. n and m represent the alignment of two points. The offset between the x and y coordinates |
<<: Example of using negative margin to achieve average layout in CSS
>>: vsftpd virtual user based on MySql authentication
Portainer Introduction Portainer is a graphical m...
Standalone hbase, let’s talk about it first. Inst...
CSS matches multiple classes The following HTML t...
This article mainly introduces the typing effect ...
Table of contents Creating HTML Pages Implement t...
The situation is as follows: (PS: The red box repr...
Hexadecimal code table of various colors [Part 1] ...
1. Node server setup + database connection The op...
Permissions and database design User Management U...
Application example website http://www.uhuigou.net...
I started using Linux for development and enterta...
1. Copy the configuration file to the user enviro...
Looking at a website is actually like evaluating a...
I have recently studied the hollowing effect. bac...
Display different menu pages according to the use...