facebook

Font Color of TEXT in ListItem always gray during runtime

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #341460 Reply

    rescuediver
    Member

    I am having a problem with the color of Text in List Items… During design time I can change the color of the text to any color and any size. But during run time when my Javascript fills the ListItems with text, the Text is always grey, with a Font size of 17

    I just want the text to be Black, but obviously setting this property during design is not working

    Any Help… greatly appreciated

    #341461

    We determined that the root of the problem is in the many new styling customizations introduced in Mobione 2.1. Thus your javascript is generating list-items that do not conform to the 2.1 list-item implementation.

    Adding the new css classes used in 2.1 on your list code generation should fix the problem. See attached image.

    '       <div id="m1-list-text2" class="m1-text m1-font-2 m1-active-color-1">Item-' + i + '</div>'+

    Let me know how it goes and if you need further assistance.

    Attachments:
    You must be logged in to view attached files.
    #341495

    rescuediver
    Member

    Hello Thanks for the help…

    I am currently using Mobo 2.3.2

    I should explain better…

    In the design center I created a list with 3 blank list Items. And have set their Font color to Black in the properties section.

    My javascript merely adds text to the list items that have already been generated in the design center.

    Here is my only code concerning the listitem text

    document.getElementById(“m1-Untitled1-listItem1″).innerHTML=dealer[0].Bigname+” : “+dealer[0].distance.toFixed(2)+” NM”;

    Do I need to modify a CSS file that was generated by the DesignCenter?

    Thanks

    P.S. I love the puzzles in the Key Captcha thingy

    #341572

    support-michael
    Keymaster

    @rescuediver
    There is an issue with your code snippet.

    Here is an example (see attachment below). Let’s say you have a list-item with a Text label widget (default) that has the id=”text1″.
    See attachment list-item-ss1.png

    I can replace the Text widget’s content with a snippet of jquery javascript code similar to the following.

    
    //Find the html element (a <div>) who's ID ends with the string 'text1'.
    //Then update the element's text. 
    $('[id$=text1]').text('hello world')
    

    See attachment list-item-ss2.png

    Src code
    See attachment test.mobi

    Attachments:
    You must be logged in to view attached files.
    #341580

    rescuediver
    Member

    Hello Support,

    I don’t know why using standard Javascript doesn’t work but using the JSQuery statement did work.

    At this point I don’t care… I am happy to have my problem solved, and now I must learn how to use JSQuery!!

    Thank You Very Much!!!!

    #341581

    Unknown Author
    Participant

    For dynamic lists, you can hard-code

    <FONT COLOR=Whatever></FONT>

    to get the right text color – or even change text color between list items.

    -1TC

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Font Color of TEXT in ListItem always gray during runtime

You must be logged in to post in the forum log in