jquery setting an inline width property problem -


I am using a jcarousel, and I need to clearly specify the width of each IMG. The problem is, that it actually has to work width = "". What is a way to add an inline width to the image? I tried:

  & lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ ('tab-item-photo img'). Each (function () {$ (this) .css ("width", "100px");})}} ;   

This size changes to the image, but it does not add the inline style width, so jcarousel's functionality does not work.

Any thoughts on this?

Thanks, H.

This is setting the CSS property, but it seems that you talk about the width feature Trying $ (this) .attr ('width', '100px');

EDIT: In fact, there is an easy way to implement the same thing, which will be a little less rational.

Your description above will be

  $ ('. Tab-item-photo img'). CSS ('width', '100px');   

If you are not working from css to ATR , you can also try to add it to the style attribute. If you know that the style feature is already empty, you can

  $ ('. Tab-item-photo img'). Attr ('style', 'width: 100px');   

Otherwise, you will need to purge the outside width from the existing style attribute and add it back. Ideally, you can call it .css () but apparently does not play well with your Jarosellel code.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

c# - Confused over DLL entry points (entry point not found exception) -