Design and CSS styles
Version 5.x > Design and CSS styles > ScrollingText definition of width View modes: 
User avatar
Member
Member
Kit-Webtech - 6/24/2011 11:06:03 AM
   
ScrollingText definition of width
Due to the design of my page, I need the scrollingText DIV element to adjust to percentages not PX.
Where can I make that adjustment? In the configuration I am only given a PX width option. The ScrollingText.ascx.cs Div properties say this:

public int DivWidth
{
get
{
return ValidationHelper.GetInteger(GetValue("DivWidth"), 300);
}
set
{
SetValue("DivWidth", value);
}
}

But I don't know how to change that so that my width measurement ends up being 98% of the column width.

User avatar
Member
Member
kentico_michal - 6/26/2011 1:37:28 AM
   
RE:ScrollingText definition of width
Hello,

You will need to modify the Scrolling text web part and adjust its code so that the DivWidth would be considered as a property defined in percent instead of pixels.

Best regards,
Michal Legen

User avatar
Member
Member
Kit-Webtech - 6/27/2011 10:45:43 AM
   
RE:ScrollingText definition of width
Thank you, Michal, but the clip I pasted in my post IS from the webpart. I see no spot where 'pixel' is defined where I could change it to percentage.
Could you tell me in which section of which file this definition is located?
I have went line by line through both the ScrollingText.ascx and the ScrollingText.ascx.cs file, and I cannot find it.

User avatar
Member
Member
kentico_michal - 6/29/2011 1:46:59 AM
   
RE:ScrollingText definition of width
Hello,

The DivWidth is just a property that has some value (in this case default value is 300). You need to change the styles that are generated in the code of the web part according to your needs. For example:

mStyleOptions = "width: " + DivWidth + "px; height: " + DivHeight + "px; overflow: hidden; position: absolute; left: 0px;";

There are some other places where the DivWidth property is used in the code behind. You can find them by searching for the expression DivWidth.
Please do not forget to clone the the web part before any modification: Modifying the code of standard web parts

Best regards,
Michal Legen

User avatar
Member
Member
Kit-Webtech - 6/30/2011 1:38:18 PM
   
RE:ScrollingText definition of width
I have found the spots where it says mStyleOptions, I cloned the webpart, but I still cannot change the div into percentage width. Can you tell me what that line
mStyleOptions = "width: " + DivWidth + "px; height: " + DivHeight + "px; overflow: hidden; position: absolute; left: 0px;";
needs to say in order for me to be able to use percentage? I am not familiar with C# and am really lost. I tried to replace the letters px with a variety of %, (percent) ... but nothing works.
Can I please get some assistance on this?

User avatar
Member
Member
Kit-Webtech - 6/30/2011 2:48:15 PM
   
RE:ScrollingText definition of width - SOLVED
Sorry, I should have waited longer for the cache to clear.

This worked:

In the ScrollingText.ascx.cs file, I replaced

mStyleOptions = "width: " + DivWidth + "px; height: " + DivHeight + "px; overflow: hidden; position: absolute; left: 0px;";

with

mStyleOptions = "width: " + DivWidth + "(percent); height: " + DivHeight + "(percent); overflow: hidden; position: absolute; left: 0px;";