Hi Team
I have cart-popup but the problem is the size is not the same as cart when view-detail is clicked. Can anyone help to the get the same size of the cart-popup, jquery is fine i need the size to the same with cart. Currently its seem overlaping the same when user click view-detail.
Colorful Stylish Shirt 0
R120.00
R120.00
Colorful Stylish Shirt 1
R121.00
R121.00
Guest UserPosted May 10, 2023, 12:02 PM
Hi Rawat
This is an output when its view-details look at the size, want the cart-popup to be same as cart.
Deepak RawatPosted May 10, 2023, 10:53 AM
can i see the output image. and inspect eliment ?
Guest UserPosted May 10, 2023, 10:49 AM
Hi Guys
Based on the given answers, i have used css styles but when click view-details the cart-popup-0, 1, 2 etc still same. See my code below. What am missing please advice
Deepak RawatPosted May 10, 2023, 10:30 AM
in this case you need to make height:auto; and float:left; then it will auto adjust the content size
Prathap ReddyPosted May 10, 2023, 9:53 AM
To make the size of the cart-popup the same as the cart, you can use the same CSS styles for both elements. Based on the provided markup, it seems like the card elements in both the cart and the cart-popup have the same structure.
You can add a class to the card elements in the cart-popup and then use the same CSS styles that are applied to the card elements in the cart. Here's an example of how you can do that using jQuery:
javascript code:
$(document).ready(function() {
// Get the width and height of the card element in the cart
var cardWidth = $('.product-item').width();
var cardHeight = $('.product-item').height();
// Set the width and height of the card element in the cart-popup
$('.card-popup .card').css({
'width': cardWidth + 'px',
'height': cardHeight + 'px'
});
});
This code gets the width and height of the card element in the cart using the
width()andheight()functions in jQuery, and then sets the same width and height to the card element in the cart-popup using thecss()function. You can adjust the code to fit your specific markup and CSS styles.