Changeset 12946


Ignore:
Timestamp:
2006-09-29T15:37:06+12:00 (18 years ago)
Author:
mdewsnip
Message:

Added Javascript from Catalone for random image on the home page.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cic-hcap/macros/extra.dm

    r12940 r12946  
    113113_cicmenujavascript_
    114114_query:cicjavascript_
     115_cicpagejavascript_
    115116</head>
    116117
     
    142143package home
    143144
     145_cicpagejavascript_ {
     146<script type="text/javascript">
     147var photos = new Array();
     148photos[1] = "Timothy Alden and Alexander Temple, <i>Bentley Hall<\\/i> (1820), Allegheny College (PA)";
     149photos[2] = "James Key Wilson (Walter & Wilson), <i>Old Main (view from the southwest)<\\/i> (1858-71 and later), Bethany College (WV)";
     150photos[3] = "Marcel Breuer, <i>Abbey Church and Bell Tower<\\/i> (1958-61), Saint John's University (MN)";
     151photos[4] = "John Shaver & Co., <i>Eugene E. Clossen Physical Education Center<\\/i> (1967), Graceland University (IA)";
     152photos[5] = "<i>East Hall<\\/i> (1909), Oakwood College, Huntsville (AL)";
     153photos[6] = "<i>Ralston Hall (view from the northwest)<\\/i> (late 1860s), Notre Dame de Namur University (CA)";
     154photos[7] = "O'Meara and Hills & G.E. Quick, <i>Our Lady Queen of Peace Chapel and College Library<\\/i> (1938), College of St. Scholastica (MN)";
     155photos[8] = "Fonthill Castle 1852, orig. constr.; 1872 add'n), College of Mount Saint Vincent (NY)";
     156photos[9] = "Gordon Kaufman, Edward Huntsman-Trout, and others, em>Jaqua Quadrangle<\\/i> (1926-73), Scripps College (CA)";
     157photos[10] = "T. D. McLaughlin and Oliver Davidson, <i>Musselman Library<\\/i> (1929-30), Bluffton University (OH)";
     158photos[11] = "John CarrÚre & Thomas Hastings,<i>Hotel Ponce de Leon and Residence Hall<\\/i> (1885-88), Flagler College (FL)";
     159photos[12] = "";
     160photos[13] = "Peabody & Stearns, <i>Rosary Hall<\\/i> (1905), Albertus Magnus College (CT)";
     161photos[14] = "<i>John Umble Center or the Performing Arts<\\/i> (1976-79), Goshen College (IN)";
     162photos[15] = "<i>Old Main (Hauptgebaude)<\\/i> Elmhurst College (IL)";
     163photos[16] = "Tallman & Tallman, <i>Dillingham Center<\\/i> (1969), Ithaca College (NY)";
     164photos[17] = "Philip Johnson, <i>Chapel of St. Basil<\\/i> 1957, orig. master plan; 1997 chapel completed), University of St. Thomas (TX)";
     165photos[18] = "<i>Cast iron gazebo<\\/i> (early 19th century), at center of gardens at Belmont University (TN)";
     166photos[19] = "";
     167
     168window.onload = function() \{
     169   // Function called when page loads
     170   if (!document.getElementById) return;
     171   if (!document.getElementById('cichomephoto')) return;
     172
     173   var rand = get_random(photos.length);
     174   var photo = document.getElementById('cichomephoto');
     175   photo.setAttribute('src', '_httpcollection_/images/mainphoto/' + rand + '.jpg');
     176   photo.setAttribute('alt', photos[rand]);
     177\}
     178
     179function get_random(max) \{
     180   var randNum = Math.floor(Math.random()*(max-1))+1;
     181   return randNum;
     182\}
     183</script>
     184}
     185
    144186_cicpagecontent_ {
    145187<table cellspacing="0" cellpadding="0">
    146188  <tr>
    147189    <td id="cichomephotoarea">
    148       <img id="cichomephoto" src="_httpcollection_/images/mainphoto/1.jpg" alt="HCAP Photo" /><br />
     190      <img id="cichomephoto" src="_httpcollection_/images/mainphoto/blank.gif" alt="HCAP Photo" /><br />
    149191      <span class="caption">&nbsp;</span>
    150192    </td>
Note: See TracChangeset for help on using the changeset viewer.