Wrong width for React Slick Slider in Responsive ViewRerender view on browser resize with ReactReact-slick Slider stays on same page if slides items are changedReact-slick not rendering slidesChange div size dynamically based on background-image aspect ratio and fixed heightDisable React slick slider at Min widthreact-slick with width=0 (img not displaying)React-slick: how sync 3 slidersAdd dots in each slide with React Slick sliderConsistency issue in react-slickHow to add slick-active class in Slider dots in React Slick
Cuban Primes
Assembly writer vs compiler in VLIW architecture
Will the volt, ampere, ohm or other electrical units change on May 20th, 2019?
Break long word (not long text!) in longtable cell
How could it be that 80% of townspeople were farmers during the Edo period in Japan?
Would life always name the light from their sun "white"
What was Varys trying to do at the beginning of S08E05?
It is as easy as A B C, Figure out U V C from the given relationship
Why is the Advance Variation considered strong vs the Caro-Kann but not vs the Scandinavian?
Wireless headphones interfere with Wi-Fi signal on laptop
Why would company (decision makers) wait for someone to retire, rather than lay them off, when their role is no longer needed?
Why does SSL Labs now consider CBC suites weak?
How to redirect stdout to a file, and stdout+stderr to another one?
When did game consoles begin including FPUs?
Were any toxic metals used in the International Space Station?
Aligning group plot titles horizontally
Why can't I share a one use code with anyone else?
What metal is most suitable for a ladder submerged in an underground water tank?
Meaning of "legitimate" in Carl Jung's quote "Neurosis is always a substitute for legitimate suffering."
Single word that parallels "Recent" when discussing the near future
Why were the bells ignored in S8E5?
Is the seat-belt sign activation when a pilot goes to the lavatory standard procedure?
Is random forest for regression a 'true' regression?
tikz drawing rectangle discretized with triangle lattices and its centroids
Wrong width for React Slick Slider in Responsive View
Rerender view on browser resize with ReactReact-slick Slider stays on same page if slides items are changedReact-slick not rendering slidesChange div size dynamically based on background-image aspect ratio and fixed heightDisable React slick slider at Min widthreact-slick with width=0 (img not displaying)React-slick: how sync 3 slidersAdd dots in each slide with React Slick sliderConsistency issue in react-slickHow to add slick-active class in Slider dots in React Slick
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have implemented React Slick Slider for my website, it works proper for desktop view and take proper width accordingly, but if I switch to responsive view the width of the container is not proper and it looks all distorted.
I have tried to fix it with CSS, given 100% width to the slick-track
div but nothing worked.
Following is the container : slick-track and below is the inline css being added :
width: 2.14748e+08px;
opacity: 1;
transform: translate3d(-8.05305e+07px, 0px, 0px);
Below is how I am initializing the slider in my component:
const settings =
dots: false,
infinite: true,
speed: 500,
cssEase: 'linear',
slidesToShow: this.props.data && this.props.data.upSell && this.props.data.upSell.length>=5?6:this.props.data&& this.props.data.upSell && this.props.data.upSell.length,
rtl: rtl === "en" ? false : true,
slidesToScroll: 1,
asNavFor: null,
arrows: false,
initialSlide: rtl==="en"?0:2,
responsive: [
breakpoint: 768,
settings:
slidesToShow: 2,
slidesToScroll: 1,
infinite: true,
initialSlide: rtl==="en"?0:3,
dots: false
]
;
Below is the sample HTML structure in a loop :
<Slider className="mx-4" ...settings ref=c => (this.slider = c)>
<div class="rtl product-item" tabindex="-1" style="width: 100%; display: inline-block;">
<div class="product-shop-top">
<a href="#"><img src="" alt="" class="product-img"></a>
</div>
<div class="product-item-details">
<h5><a href="#">Product Name</a></h5>
<div class="price-wrapper">
<div class="price-box"><span class="special-price">65</span></div>
</div>
</div>
<div class="buynow-block asas"><button type="button" title="Add to Cart" class="action tocart primary"> </button><a class="towishlist">Add to Wishlist</a></div>
</div>
</Slider>
Note: Attaching the image to show the result.
I want 2 columns in a row for responsive slick slider.
javascript reactjs ecmascript-6 responsive-design react-slick
add a comment |
I have implemented React Slick Slider for my website, it works proper for desktop view and take proper width accordingly, but if I switch to responsive view the width of the container is not proper and it looks all distorted.
I have tried to fix it with CSS, given 100% width to the slick-track
div but nothing worked.
Following is the container : slick-track and below is the inline css being added :
width: 2.14748e+08px;
opacity: 1;
transform: translate3d(-8.05305e+07px, 0px, 0px);
Below is how I am initializing the slider in my component:
const settings =
dots: false,
infinite: true,
speed: 500,
cssEase: 'linear',
slidesToShow: this.props.data && this.props.data.upSell && this.props.data.upSell.length>=5?6:this.props.data&& this.props.data.upSell && this.props.data.upSell.length,
rtl: rtl === "en" ? false : true,
slidesToScroll: 1,
asNavFor: null,
arrows: false,
initialSlide: rtl==="en"?0:2,
responsive: [
breakpoint: 768,
settings:
slidesToShow: 2,
slidesToScroll: 1,
infinite: true,
initialSlide: rtl==="en"?0:3,
dots: false
]
;
Below is the sample HTML structure in a loop :
<Slider className="mx-4" ...settings ref=c => (this.slider = c)>
<div class="rtl product-item" tabindex="-1" style="width: 100%; display: inline-block;">
<div class="product-shop-top">
<a href="#"><img src="" alt="" class="product-img"></a>
</div>
<div class="product-item-details">
<h5><a href="#">Product Name</a></h5>
<div class="price-wrapper">
<div class="price-box"><span class="special-price">65</span></div>
</div>
</div>
<div class="buynow-block asas"><button type="button" title="Add to Cart" class="action tocart primary"> </button><a class="towishlist">Add to Wishlist</a></div>
</div>
</Slider>
Note: Attaching the image to show the result.
I want 2 columns in a row for responsive slick slider.
javascript reactjs ecmascript-6 responsive-design react-slick
add a comment |
I have implemented React Slick Slider for my website, it works proper for desktop view and take proper width accordingly, but if I switch to responsive view the width of the container is not proper and it looks all distorted.
I have tried to fix it with CSS, given 100% width to the slick-track
div but nothing worked.
Following is the container : slick-track and below is the inline css being added :
width: 2.14748e+08px;
opacity: 1;
transform: translate3d(-8.05305e+07px, 0px, 0px);
Below is how I am initializing the slider in my component:
const settings =
dots: false,
infinite: true,
speed: 500,
cssEase: 'linear',
slidesToShow: this.props.data && this.props.data.upSell && this.props.data.upSell.length>=5?6:this.props.data&& this.props.data.upSell && this.props.data.upSell.length,
rtl: rtl === "en" ? false : true,
slidesToScroll: 1,
asNavFor: null,
arrows: false,
initialSlide: rtl==="en"?0:2,
responsive: [
breakpoint: 768,
settings:
slidesToShow: 2,
slidesToScroll: 1,
infinite: true,
initialSlide: rtl==="en"?0:3,
dots: false
]
;
Below is the sample HTML structure in a loop :
<Slider className="mx-4" ...settings ref=c => (this.slider = c)>
<div class="rtl product-item" tabindex="-1" style="width: 100%; display: inline-block;">
<div class="product-shop-top">
<a href="#"><img src="" alt="" class="product-img"></a>
</div>
<div class="product-item-details">
<h5><a href="#">Product Name</a></h5>
<div class="price-wrapper">
<div class="price-box"><span class="special-price">65</span></div>
</div>
</div>
<div class="buynow-block asas"><button type="button" title="Add to Cart" class="action tocart primary"> </button><a class="towishlist">Add to Wishlist</a></div>
</div>
</Slider>
Note: Attaching the image to show the result.
I want 2 columns in a row for responsive slick slider.
javascript reactjs ecmascript-6 responsive-design react-slick
I have implemented React Slick Slider for my website, it works proper for desktop view and take proper width accordingly, but if I switch to responsive view the width of the container is not proper and it looks all distorted.
I have tried to fix it with CSS, given 100% width to the slick-track
div but nothing worked.
Following is the container : slick-track and below is the inline css being added :
width: 2.14748e+08px;
opacity: 1;
transform: translate3d(-8.05305e+07px, 0px, 0px);
Below is how I am initializing the slider in my component:
const settings =
dots: false,
infinite: true,
speed: 500,
cssEase: 'linear',
slidesToShow: this.props.data && this.props.data.upSell && this.props.data.upSell.length>=5?6:this.props.data&& this.props.data.upSell && this.props.data.upSell.length,
rtl: rtl === "en" ? false : true,
slidesToScroll: 1,
asNavFor: null,
arrows: false,
initialSlide: rtl==="en"?0:2,
responsive: [
breakpoint: 768,
settings:
slidesToShow: 2,
slidesToScroll: 1,
infinite: true,
initialSlide: rtl==="en"?0:3,
dots: false
]
;
Below is the sample HTML structure in a loop :
<Slider className="mx-4" ...settings ref=c => (this.slider = c)>
<div class="rtl product-item" tabindex="-1" style="width: 100%; display: inline-block;">
<div class="product-shop-top">
<a href="#"><img src="" alt="" class="product-img"></a>
</div>
<div class="product-item-details">
<h5><a href="#">Product Name</a></h5>
<div class="price-wrapper">
<div class="price-box"><span class="special-price">65</span></div>
</div>
</div>
<div class="buynow-block asas"><button type="button" title="Add to Cart" class="action tocart primary"> </button><a class="towishlist">Add to Wishlist</a></div>
</div>
</Slider>
Note: Attaching the image to show the result.
I want 2 columns in a row for responsive slick slider.
javascript reactjs ecmascript-6 responsive-design react-slick
javascript reactjs ecmascript-6 responsive-design react-slick
asked Mar 23 at 15:08
H.HusainH.Husain
549
549
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Finally I was able to figure out the issue, the container for slider was inside the same row where other elements on the pages were, this was causing the issue where slider was unable to calculate the width. The structure was like this before :
<div classname="row">
<div classname="elementone"></div>
<div classname="elementtwo"></div>
<div classname="slider"></div>
</div>
So I have moved the slider outside the row and it works fine now.
Mark yuor own answer as the answer, (the small tick next your question)
– Dehan de Croos
Mar 24 at 15:37
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55315133%2fwrong-width-for-react-slick-slider-in-responsive-view%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Finally I was able to figure out the issue, the container for slider was inside the same row where other elements on the pages were, this was causing the issue where slider was unable to calculate the width. The structure was like this before :
<div classname="row">
<div classname="elementone"></div>
<div classname="elementtwo"></div>
<div classname="slider"></div>
</div>
So I have moved the slider outside the row and it works fine now.
Mark yuor own answer as the answer, (the small tick next your question)
– Dehan de Croos
Mar 24 at 15:37
add a comment |
Finally I was able to figure out the issue, the container for slider was inside the same row where other elements on the pages were, this was causing the issue where slider was unable to calculate the width. The structure was like this before :
<div classname="row">
<div classname="elementone"></div>
<div classname="elementtwo"></div>
<div classname="slider"></div>
</div>
So I have moved the slider outside the row and it works fine now.
Mark yuor own answer as the answer, (the small tick next your question)
– Dehan de Croos
Mar 24 at 15:37
add a comment |
Finally I was able to figure out the issue, the container for slider was inside the same row where other elements on the pages were, this was causing the issue where slider was unable to calculate the width. The structure was like this before :
<div classname="row">
<div classname="elementone"></div>
<div classname="elementtwo"></div>
<div classname="slider"></div>
</div>
So I have moved the slider outside the row and it works fine now.
Finally I was able to figure out the issue, the container for slider was inside the same row where other elements on the pages were, this was causing the issue where slider was unable to calculate the width. The structure was like this before :
<div classname="row">
<div classname="elementone"></div>
<div classname="elementtwo"></div>
<div classname="slider"></div>
</div>
So I have moved the slider outside the row and it works fine now.
answered Mar 24 at 12:43
H.HusainH.Husain
549
549
Mark yuor own answer as the answer, (the small tick next your question)
– Dehan de Croos
Mar 24 at 15:37
add a comment |
Mark yuor own answer as the answer, (the small tick next your question)
– Dehan de Croos
Mar 24 at 15:37
Mark yuor own answer as the answer, (the small tick next your question)
– Dehan de Croos
Mar 24 at 15:37
Mark yuor own answer as the answer, (the small tick next your question)
– Dehan de Croos
Mar 24 at 15:37
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55315133%2fwrong-width-for-react-slick-slider-in-responsive-view%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown