Slick inside fieldset, on Chrome causes crazy width calcs
See original GitHub issueAt this stage I haven’t had a chance to dig into the code and see what is happening, but here’s the repeatable issue.
If the carousel is inside a fieldset and you view it on Google Chrome, the slick-slide width gets blown right out (22000+), and it keeps getting bigger if you click on arrows etc
Stripped down the code to below, which demonstrates the issue. I f you remove the fieldset tag, all works as expected
http://jsfiddle.net/jimmyrose/fc5mmtmh/1/
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<link href="/Vendor/slick-1.3.13/slick/slick.css" rel="stylesheet"/>
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
</head>
<body>
<fieldset>
<legend>Photos</legend>
<div class="carousel">
<div class="attachment"><img src="/Attachments/View/88?thumb=True" title="" alt="Jellyfish.jpg"/></div>
<div class="attachment"><img src="/Attachments/View/88?thumb=True" title="" alt="Jellyfish.jpg"/></div>
<div class="attachment"><img src="/Attachments/View/88?thumb=True" title="" alt="Jellyfish.jpg"/></div>
<div class="attachment"><img src="/Attachments/View/88?thumb=True" title="" alt="Jellyfish.jpg"/></div>
<div class="attachment"><img src="/Attachments/View/88?thumb=True" title="" alt="Jellyfish.jpg"/></div>
<div class="attachment"><img src="/Attachments/View/88?thumb=True" title="" alt="Jellyfish.jpg"/></div>
<div class="attachment"><img src="/Attachments/View/88?thumb=True" title="" alt="Jellyfish.jpg"/></div>
<div class="attachment"><img src="/Attachments/View/88?thumb=True" title="" alt="Jellyfish.jpg"/></div>
</div>
</fieldset>
<script type="text/javascript" src="/Vendor/slick-1.3.13/slick/slick.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('.carousel').slick({
slidesToShow: 4,
slidesToScroll: 2
});
});
</script>
</body>
</html>
Issue Analytics
- State:
- Created 9 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Google Chrome - Fieldset Overflow Bug
Chrome defines for fieldset the default user agent style: min-width: -webkit-min-content . So when your viewable area (aka "screen") is smaller ...
Read more >Untitled
Fieldset width in jsp, Max pending connections wcf? Owa public folders exchange 2010, Poly bottle chemistry, Raphael js svg icons, Nsb 40-25?
Read more >Untitled
Ciudad de tobati en guarani, Tollytots 5-in-1 graco doll stroller, Reproducir mkv en tv, ... Cafe astrology transit calculator, Nba best teams in...
Read more >Slick not compatible with latest chrome 80 update - Drupal
I am definitely seeing similar results as @tramsaal, slide widths initializing correctly and then blowing way out of proportion. There appears ...
Read more >Styling Radio Buttons with CSS (59 Custom Examples)
But what makes these buttons so special is the animation. ... The CSS buttons only work in Chrome, but the original ones work...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think I have a solution, it just involves overriding a Chrome default for min-width: http://jsfiddle.net/bpccL230/1/
Set the width on the carousel with jQuery like this (instead of CSS):
$(“#carousel”).width($(window).width());
To run the above code whenever the window is resized, you can do this:
$(window).resize(function(){ $(“#carousel”).width($(window).width()); });