STREETS IN TIME PROJECT: Javascript code for populating ‘alt’ tags for images

Javascript variables  in <head> section, to be populated each time a new page is created:

<script type = "text/javascript">
var image_loc = "The Booth Museum, Dyke Road, Hove"
var year_then = "1905"
var year_now = "2013"
</script>

Variables called within ‘alt’ tag for then and now images:

<script> document.write("<div id= 'slideshow'><img src = '"+image_now+"' alt = '"+image_loc+", "+year_now+"'/><img src = '"+image_then+"' alt = '"+image_loc+", "+year_then+"'/></div>") </script>

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s