Comments (9)
If I use plugin in basic way: $('.block').matchHeight('.row-blocks'); everything works well, but window freezes/lags during resizing.
Can you confirm this gives the correct result?
If that does work, I think the real problem here is the freeze / lag during resizing?
If this is the case, I can add an option to limit the update rate to prevent this.
from jquery-match-height.
Thanks for reply. :)
There is problem with $('.block').matchHeight('.row-blocks'); in some case, but I didn't mention this before because I'm not sure if this is a fault of your plugin.
In some places there are responsive tabs (https://github.com/petelove666/Responsive-Tabs), which contain responsive carousels (http://www.owlgraphic.com/owlcarousel/) with equal height blocks (graphic designer had a lot of fun designing it :/). When page is launched first time (not cached), somethimes when tab is closed and then is opened, blocks have height 0px (maybe because they have property display: none?). But when I resize window, script works for this tab and divs has equal height but always - the rest of blocks in hidden tabs has no height again. If I use script with 'apply' and 'update' methods, there is no problem (except switching desktop/mobile view and vice versa what I've posted above). I handle tabs issue this way that on each click tab event 'update' method is called and everything looks OK.
Anyway, limit update rate could be a nice feature. :)
$(window).load(function () {
// other stuff
$('.block').matchHeight('.row-blocks');
RESPONSIVEUI.responsiveTabs();
$('.responsive-tabs li, .responsive-tabs h2').click(function () {
$.fn.matchHeight._update();
});
});
from jquery-match-height.
You need to apply matchHeight
before you apply anything else like tabs that may hide your content because the height will become 0. matchHeight can't work on content that is hidden.
Then if things are changing size dynamically that's not based on resize event, you then need to manually call $.fn.matchHeight._update
after the change (you may also need to temporarily disable the hiding that the tabs plugin is using and apply it after update).
I'll look into doing an option to limit the rate
from jquery-match-height.
OK, thanks for advice. I'll figure sth out.
from jquery-match-height.
I've added a throttle method in 6d9a6a7
Can you grab a copy of the latest build and confirm if this solves your issue so I can close this?
You can change the throttle like so:
$.fn.matchHeight._throttle = 80;
By default, the _update
method is throttled to execute at a maximum rate of once every 80ms
.
Decreasing the above _throttle
property will update your layout quicker, appearing smoother during resize, at the expense of performance.
If you experience lagging or freezing during resize, you should increase the _throttle
property.
from jquery-match-height.
Sure, I'll test it tomorrow at work :) . I've decided to use your script only with
from jquery-match-height.
Yep, the throttle is on by default now when using $.matchHeight()
from jquery-match-height.
Windows resize much faster. Thank you for your plugin and support :) .
from jquery-match-height.
Awesome, thanks
from jquery-match-height.
Related Issues (20)
- Footer not staying on bottom of div HOT 3
- Rounding down height HOT 2
- Firefox Quantum problem HOT 2
- Add option to disable auto matching data-mh HOT 2
- It is posible to disable byRow option with data-api? HOT 2
- Columns only firing on window reload w/AJAX + Facet WP HOT 1
- Match height only working on certain pages HOT 1
- only firing on some elements, not all - but all on resize HOT 4
- wildcard target class?
- Latest jquery HOT 3
- Matchheight stopped working on orientation change on all my sites HOT 1
- Height matching AJAXed elements using [data-mh] method HOT 2
- How to work with Accrodion content Parent matchheight detected rows should still work.
- A different, faster approach?
- Overlapping elements HOT 2
- Issue with nth-child and display property.
- Having multiple 'property' attributes
- Error
- documentation for _update and _applyDataApi
- When Code Splitting and adding jquery-match-height to the second script file it fails to register.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-match-height.