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

Product margins set with inline javascript...

2 years 3 weeks ago - 2 years 3 weeks 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 weeks 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 2 weeks ago #14992 by gjhoutepen
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 2 weeks 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.138 seconds
Powered by Kunena Forum

Latest from our blog

DecoNetwork 8 - Update 3: GDPR Compliance (+56 tasks completed)

DecoNetwork 8 - Update 3: GDPR Compliance (+56 tasks completed) In this release, DecoNetwork updated its Privacy Policy and Terms of Use, effective May 23, 2018. These changes were made primarily in preparation...Read More

This Week in Catalog - May 18, 2018

This Week in Catalog - May 18, 2018 I have two big announcements to make in regards to the DecoNetwork catalogs. We read and listen to your complaints and suggestions. Recently, I...Read More

DecoNetwork 8 - Available Now!

DecoNetwork 8 - Available Now! After an incredible amount of work in design, development, and testing, DecoNetwork 8 is here! With version 8, we recommitted ourselves...Read More

This Week in Catalog: May 11, 2018

This Week in Catalog: May 11, 2018 Lately, we've been getting a lot of new products in each week. More than is typical. All those new products (mostly in the S&S Activewear...Read More

DecoNetwork 8 - Update 2 now available: SEO Improvements and more (+75 tasks implemented)

DecoNetwork 8 - Update 2 now available: SEO Improvements and more (+75  tasks implemented) DecoNetwork 8 was released just ten days ago, but we have already a second update (8.002) available for you with many improvements and fixes...Read More