Line 4: | Line 4: | ||
<script src="https://2016.igem.org/Team:Imperial_College/Resources/JS:ImageMap?action=raw&ctype=text/js"></script> | <script src="https://2016.igem.org/Team:Imperial_College/Resources/JS:ImageMap?action=raw&ctype=text/js"></script> | ||
+ | <script> | ||
+ | $(function(){ | ||
+ | var image_is_loaded = false; | ||
+ | $("#my_image").load(function() { | ||
+ | $(this).data('width', $(this).attr('width')).data('height', $(this).attr('height')); | ||
+ | $($(this).attr('usemap')+" area").each(function(){ | ||
+ | $(this).data('coords', $(this).attr('coords')); | ||
+ | }); | ||
+ | |||
+ | $(this).css('width', '100%').css('height','auto').show(); | ||
+ | |||
+ | image_is_loaded = true; | ||
+ | $(window).trigger('resize'); | ||
+ | }); | ||
+ | |||
+ | |||
+ | function ratioCoords (coords, ratio) { | ||
+ | coord_arr = coords.split(","); | ||
+ | |||
+ | for(i=0; i < coord_arr.length; i++) { | ||
+ | coord_arr[i] = Math.round(ratio * coord_arr[i]); | ||
+ | } | ||
+ | |||
+ | return coord_arr.join(','); | ||
+ | } | ||
+ | $(window).on('resize', function(){ | ||
+ | if (image_is_loaded) { | ||
+ | var img = $("#my_image"); | ||
+ | var ratio = img.width()/img.data('width'); | ||
+ | |||
+ | $(img.attr('usemap')+" area").each(function(){ | ||
+ | console.log('1: '+$(this).attr('coords')); | ||
+ | $(this).attr('coords', ratioCoords($(this).data('coords'), ratio)); | ||
+ | }); | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | </script> | ||
<style> | <style> |
Revision as of 08:35, 19 August 2016
Team Introduction
Bunch of nerds
![](https://static.igem.org/mediawiki/2016/9/91/T--Imperial_College--MemberPic.gif)
Stefan Grossfurthner
3rd Year Bio Technology
Cactus
![](https://static.igem.org/mediawiki/2016/9/91/T--Imperial_College--MemberPic.gif)
Alice Boo
3rd Year Biomedical Engineering
Fairy
Lisa Asher
3rd year Biomedical Engineering
The food of my people is the best.
![](https://static.igem.org/mediawiki/2016/9/91/T--Imperial_College--MemberPic.gif)
![](https://static.igem.org/mediawiki/2016/9/91/T--Imperial_College--MemberPic.gif)
Carter Teal
3rd year Biomedical Engineering
Wiki destroyer
Aditi Satija
2nd year Biology
Things
![](https://static.igem.org/mediawiki/2016/9/91/T--Imperial_College--MemberPic.gif)
![](https://static.igem.org/mediawiki/2016/9/91/T--Imperial_College--MemberPic.gif)
Akash B
2nd Year Bio Chemistry
Pokémon
![](https://static.igem.org/mediawiki/2016/9/91/T--Imperial_College--MemberPic.gif)
Johnny Li
3rd year Biomedical Engineering
Out of the box master
Gear
3rd year Bio Technology
Genetically Engineered Artificial Ratio
![](https://static.igem.org/mediawiki/2016/9/91/T--Imperial_College--MemberPic.gif)
![](https://static.igem.org/mediawiki/2016/9/91/T--Imperial_College--MemberPic.gif)
Alyssa
2nd year Bio Chemistry
Rocks
Akash Das
3rd year Biomedical Engineering
YAY!!!
![](https://static.igem.org/mediawiki/2016/9/91/T--Imperial_College--MemberPic.gif)
Henry
2nd year Bio Chemistry
Flower Master
![](https://static.igem.org/mediawiki/2016/9/91/T--Imperial_College--MemberPic.gif)
![](https://static.igem.org/mediawiki/2016/9/91/T--Imperial_College--MemberPic.gif)
Carys
3rd year Biomedical Engineering
Hot chocolate
Rescue Team
To our supervisors and PIs, thanks for all the help