Deutsch  

TS Image Swap

TS Code

TypoScript
######################################
#         TS Image Swap              #
# by Georg Ringer <www.ringer.it>    #
# for hjulstad.no <www.hjulstad.no>  #
######################################

lib.imageswap = COA
lib.imageswap {
	# BIG IMAGE
	1 = IMAGE
	1 {
		file {
			maxW = 400
			maxH = 300

			import= uploads/media/
			import.data = levelmedia: -1,slide
			import.listNum = 0
			import.override.field = media
		}
		params = name="image_big" class="bigimg"
	}

	# SMALL THUMBS
	10 <.1
	10 {
		file {
			maxW = 100
			maxH = 50
		}
		params = onclick="swap('image_big', this)" class="smallimg"!
		
		longdescURL.cObject = IMG_RESOURCE
		longdescURL.cObject.file {
			import.data = TSFE:lastImageInfo|origFile
			maxW = 400
			maxH = 300
		}
	}
	
	20 <.10
	20.file.import.listNum = 1
	30 <.10
	30.file.import.listNum = 2
	40 <.10
	40.file.import.listNum = 3
	50 <.10
	50.file.import.listNum = 4
	
	# JS
	100 = TEXT
	100.value (
		<script type="text/javascript">
		  <!--
		  function swap(imgname,image) { document.images[imgname].src = image.getAttribute('longdesc'); }
		  //-->
		</script>	
	)
}

Tell me what you think!

currently no new comments possible - sorry I am working on it!