× Got a CSS, HTML or webdesign question? Ask it here!

Product margins set with inline javascript...

2 years 3 months ago - 2 years 3 months ago #14976 by Ellis
The margin (left right) properties for the product list on the create page are set dynamically depending on the defined product width with the following javascript funciton...

runFuncOnLoad( function() { new Product_image('create_list', '175');});

... I suspect this sets the margins between product elements after the DOM is loaded and hence can not be over-ridden is CSS.

Is there a variable that can influence the margin calculation that adds the margin-left and margin-right properties?

John
The following user(s) said Thank You: Sewsublime

Please Log in or Create an account to join the conversation.

2 years 3 months ago #14977 by ccruz
Hey John,

Our system calculates the available space in the container and sets the margins inline so that the products are evenly spaced within.

You should be able to override the inline styles by applying !important attribute at the end of your CSS properties.

-Cris
The following user(s) said Thank You: Ellis

Please Log in or Create an account to join the conversation.

2 years 3 months ago #14992 by gjhoutepen
Replied by gjhoutepen on topic Product margins set with inline javascript...
Hey Cris,

I have a related question on this topic, if you could have a look and perhaps give some feedback would be really helpful.

The properties for image height en width are set up in Deco CMS by the pull-down list in an number of fixed values (175, 200, 250, 300x300) but we'd like to give these images 100% width and auto height. This is the script part:
<div style="height: 200px; width: 200px;">
<img src="...jpg" class="first" alt="PRODUCT NAME">
</div>

I've tried to overrule the initial width and height with:
.block img.first { height: auto !important; width: 100% !important; }

But this doesn't seem te work. Any thoughts?

Thanks,

Gert-Jan

Please Log in or Create an account to join the conversation.

2 years 3 months ago #14993 by ccruz
Hey Gert-Jan,

I won't be able to provide you direct coding assistance but if you are working with a web developer you can let them know to keep the parent elements of the image in mind when setting the width to a percentage.

-Cris

Please Log in or Create an account to join the conversation.

Time to create page: 0.113 seconds
Powered by Kunena Forum