Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: using count

  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    using count

    I'm working on putting a javascript scroller (its the ProHTML scroller) into a template. The template will loop through itself to get the current NFL schedule and provide the weather for that city. And I'm trying to understand how I can change the id to count up. The template code looks like this:
    Code:
    <div id="dropmsg0" class="dropcontent">
       <div class="progame">
          <img class="proteam"
               src="./images/nflicons/{NFL_Schedule_Excerpt.Week.Games.AWAY_TEAM_ABBREVIATION}.gif"
               alt="{NFL_Schedule_Excerpt.Week.Games.AWAY_TEAM_LOCATION} {NFL_Schedule_Excerpt.Week.Games.AWAY_TEAM_MASCOT}">
          <div class="at">at</div>
          <img class="proteam"
               src="./images/nflicons/{NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_ABBREVIATION}.gif"
               alt="{NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_LOCATION} {NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_MASCOT}"
               onclick="showWeatherPic('{NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_ABBREVIATION}')">
          <div class="gametime">{NFL_Schedule_Excerpt.Week.Games.GAME_TIME}</div>
          <div id="{NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_ABBREVIATION}forecast" class="weather">
             <?php echo $aAllCities['{NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_ABBREVIATION}']; ?>
          </div>
       </div>
     </div>
    I'm trying to have the id="dropmsg0" count up by one each time the template loop through. The scroller looks to that id to move to the next item.

  • #2
    Regular Coder
    Join Date
    Apr 2004
    Location
    Los Angeles
    Posts
    133
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Wouldn't the following work?

    PHP Code:
    $totalLoops = 10;
    for($int=0;$int<$totalLoops; $int++) {
    ?>

    <div id="dropmsg<? echo($int?>" class="dropcontent">
       <div class="progame">
          <img class="proteam"
               src="./images/nflicons/{NFL_Schedule_Excerpt.Week.Games.AWAY_TEAM_ABBREVIATION}.gif"
               alt="{NFL_Schedule_Excerpt.Week.Games.AWAY_TEAM_LOCATION} {NFL_Schedule_Excerpt.Week.Games.AWAY_TEAM_MASCOT}">
          <div class="at">at</div>
          <img class="proteam"
               src="./images/nflicons/{NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_ABBREVIATION}.gif"
               alt="{NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_LOCATION} {NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_MASCOT}"
               onclick="showWeatherPic('{NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_ABBREVIATION}')">
          <div class="gametime">{NFL_Schedule_Excerpt.Week.Games.GAME_TIME}</div>
          <div id="{NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_ABBREVIATION}forecast" class="weather">
             <?php echo $aAllCities['{NFL_Schedule_Excerpt.Week.Games.HOME_TEAM_ABBREVIATION}']; ?>
          </div>
       </div>
     </div>
    <?
    }
    ?>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •