在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:liabru/jquery-match-height开源软件地址:https://github.com/liabru/jquery-match-height开源编程语言:JavaScript 84.5%开源软件介绍:jquery.matchHeight.js
Demo - Features - Gallery - Install - Usage - Options - Data API DemoSee the jquery.matchHeight.js demo. Modern browsersIn the years since this library was originally developed there have been updates to CSS that can now achieve equal heights in many situations. If you only need to support modern browsers then consider using CSS Flexbox and CSS Grid instead. Features
GallerySee how others are using jquery.matchHeight.js InstalljQuery is required, so include it first. Download jquery.matchHeight.js and include the script in your HTML file:
You can also install using the package managers Bower and NPM.
Usage
Where The above example will set all selected elements with the class Call this on the DOM ready event (the plugin will automatically update on window load). Also see the Data API below for a simple, alternative inline usage. OptionsThe default
Where:
Data APIUse the data attribute
All elements with the same group name will be set to the same height when the page is loaded, regardless of their position in the DOM, without any extra code required. Note that Advanced UsageThere are some additional functions and properties you should know about: Manually trigger an update
If you need to manually trigger an update of all currently set groups, for example if you've modified some content. Row detectionYou can toggle row detection by setting the
Which will return an array of element selections for each row, see this thread for more information and an example. Remove bindings
This will remove all bindings for the selected elements, from all groups. Custom target element
Will set all selected elements to the height of the first item with class Custom property
This will set the Callback eventsSince matchHeight automatically handles updating the layout after certain window events, you can supply functions as global callbacks if you need to be notified:
Where Manually apply match height
Use the apply function directly if you wish to avoid the automatic update functionality. Throttling resize updates
By default, the Maintain scroll position
Under certain conditions where the size of the page is dynamically changing, such as during resize or when adding new elements, browser bugs cause the page scroll position to change unexpectedly. If you are observing this behaviour, use the above line to automatically attempt to force scroll position to be maintained (approximately). This is a global setting and by default it is Accessing current group bindings
The array that contains all element groups that have had TestsOpen If you wish to contribute functionality to this project, you are encouraged to add new tests following the same conventions. Run Run
Cloud browser testing for this project is provided by BrowserStack (which is free for open source). Known limitationsCSS transitions and animations are not supportedYou should ensure that there are no transitions or other animations that will delay the height changes of the elements you are matching, including any Delayed webfonts may cause incorrect heightSome browsers do not wait for webfonts to load before firing the window load event, so if the font loads too slowly the plugin may produce unexpected results. If this is a problem, you should call Content changes require a manual updateIf you change the content inside an element that has had Also note that previous matchHeight bindings do not apply to new elements, even if they match the selector used. In this case you must remove the old bindings and add new ones, see this comment. ChangelogTo see what's new or changed in the latest version, see the changelog Licensejquery.matchHeight.js is licensed under The MIT License (MIT)
This license is also supplied with the release and source code.
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论