www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > HTML

    HTML Discussion and technical support for building, using and deploying HTML sites.

    Reply
     
    Thread Tools Rate Thread Display Modes
      #1  
    Old 01-14-2008, 12:42 PM
    BWWebDesigns's Avatar
    BWWebDesigns BWWebDesigns is offline
    PHP Tweaker
     
    Join Date: Sep 2006
    Location: Algonac, MI
    Posts: 232
    Need help making an <ol> list count backwards

    Ok so ive seen the use of start=""

    I entered the starting number i want it to count backwards from 5 and it counts upwards from 5

    I read put a - sign before the number so i did and yay now it counts backwards BUT the numbers have the - sign before them

    So how do i manipulate a <ol> list to make it count down from 5 without any - signs displayed

    So it would look like

    5. Some info here
    4. Some info here
    3. Some info here
    2. Some info here
    1. Some info here

    As opposed to

    -5. Some info here
    -4. Some info here
    -3. Some info here
    -2. Some info here
    -1. Some info here

    Can anyone advise me how this works, im sure its something simple but ive searched the net and this site and cant find anything
    Reply With Quote
      #2  
    Old 01-14-2008, 06:34 PM
    kiwibrit kiwibrit is offline
    Registered User
     
    Join Date: Jun 2005
    Location: United Kingdom
    Posts: 995
    Reply With Quote
      #3  
    Old 01-14-2008, 06:40 PM
    BWWebDesigns's Avatar
    BWWebDesigns BWWebDesigns is offline
    PHP Tweaker
     
    Join Date: Sep 2006
    Location: Algonac, MI
    Posts: 232
    thanks but that wasnt any use really as it did not answer my question
    Reply With Quote
      #4  
    Old 01-14-2008, 07:46 PM
    felgall's Avatar
    felgall felgall is offline
    Computer Consultant
     
    Join Date: Mar 2005
    Location: Sydney, Australia
    Posts: 7,982
    Well if that didn't answer your question then what is your question? The threads on that forum entry cover all of the current and future ways of reversing the numbers on the front of an ordered list.
    __________________
    Stephen
    Reply With Quote
      #5  
    Old 01-15-2008, 09:04 AM
    WebJoel's Avatar
    WebJoel WebJoel is offline
    Super Moderator
     
    Join Date: Dec 2005
    Location: American, living in Toronto, ON. CANADA
    Posts: 6,688
    I merely glanced at the URL thread provided: it looks to me to be merely hard-coding the number of links in descending order (10, 9, 8, 7, etc.).

    This might prove unweildy if you have many <li>s and later, have to add many more...

    Thinking how an "<ul>" or also a "<ol>" operates (standard ltr, or 'left-to-right'), -one could reverse this to read "rtl" (right-to-left) so "1" is "float:right;" and #2 is also "float:right" but it lands to the immediate LEFT of "#1", and so forth...

    This could be coded something like
    Quote:
    ....
    li {float:right;...}
    ...
    with some minor tweakages, and voila! -A "<ol>" that 'counts backwards'!

    And with this, the default "display:block;" means counting vertically-bottom-to-top, and change that to "display:inline;" means counting horizontally-right-to-left...

    Quote:
    <style>
    #backwards {width:100px; height:100px; display:block; border:2px solid silver;}
    #backwards li {float:right; width:100px;}
    </style>
    ....
    Quote:
    <ol id="backwards">
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
    </ol>
    __________________
    Help Save Ana My Portal: I Build WebPages
    Pricing? Read:http://www.webdeveloper.com/forum/pricing_faq.html
    AUP: http://www.jupitermedia.com/corporate/privacy/aup.html
    I test with: Firefox, Mozilla, Opera, Safari-on-XP, Google Chrome, SeaMonkey
    Internet.com freelancers

    Last edited by WebJoel; 01-15-2008 at 09:17 AM.
    Reply With Quote
      #6  
    Old 01-25-2008, 10:14 PM
    codepoet codepoet is offline
    Registered User
     
    Join Date: Jan 2008
    Posts: 1
    Here's an alternate method using javascript. You can initially set the list numbering style to "none", set each li value, then reset the list numbering style so it is visible again.

    In code:
    Code:
    <head>
      <style type="text/css">
        #reverse { list-style-type: none }
      ...
      </style>
    </head>
    <body>
      ...
      <ol id="reverse">
        <li>One</li>
        <li>Two</li>
        <li>Three</li>
      </ol>
      <script type="text/javascript">
        <!--
          var ol = document.getElementById("reverse");
          var lis = ol.getElementsByTagName("li");
          for (var i = 1; i <= lis.length; i++)
            lis[lis.length-i].value = i;
          ol.style.listStyleType = "decimal";
        //-->
      </script>
    There seem to be some properties in drafts of CSS3 that will allow box layouts from bottom to top, but not much useful otherwise.
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 01:07 PM.



    Acceptable Use Policy

    Internet.com
    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.