Widget:Bookshelf: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 8: Line 8:
mw.loader.load('mediaWiki.user');
mw.loader.load('mediaWiki.user');


 
imageObj = new Image();
imageObj = {Hematology: {normal: '/images/3/38/Hematology-cyan.jpg', selected: '/images/3/32/Hematology-selected.jpg', faded: '/images/b/b9/Hematology-faded.jpg'},
imageObj = {Hematology: {normal:{src: '/images/3/38/Hematology-cyan.jpg'}, selected: {src: '/images/3/32/Hematology-selected.jpg'}, faded: {src: '/images/b/b9/Hematology-faded.jpg'}},
Oncology: {normal: '/images/f/fa/Oncology-cyan.jpg', selected: '/images/d/d6/Oncology-selected.jpg', faded: '/images/9/9d/Oncology-faded.jpg'},
Oncology: {normal: {src: '/images/f/fa/Oncology-cyan.jpg'}, selected: {src: '/images/d/d6/Oncology-selected.jpg'}, faded: {src: '/images/9/9d/Oncology-faded.jpg'}},
Gastroenterology: {normal: '/images/4/4a/Gastroenterology-cyan.jpg', selected: '/images/0/06/Gastroenterology-selected.jpg', faded: '/images/d/d4/Gastroenterology-faded.jpg'},
Gastroenterology: {normal: {src: '/images/4/4a/Gastroenterology-cyan.jpg'}, selected: {src: '/images/0/06/Gastroenterology-selected.jpg'}, faded: {src: '/images/d/d4/Gastroenterology-faded.jpg'}},
Nephrology: {normal: '/images/0/0b/Nephrology-cyan.jpg', selected: '/images/2/23/Nephrology-selected.jpg', faded: '/images/a/a8/Nephrology-faded.jpg'},
Nephrology: {normal: {src: '/images/0/0b/Nephrology-cyan.jpg'}, selected: {src: '/images/2/23/Nephrology-selected.jpg'}, faded: {src: '/images/a/a8/Nephrology-faded.jpg'}},
Neuro: {normal: '/images/d/dd/Neuro-cyan.jpg', selected: '/images/8/85/Neuro-selected.jpg', faded: '/images/d/d3/Neuro-faded.jpg'},
Neuro: {normal: {src: '/images/d/dd/Neuro-cyan.jpg'}, selected: {src: '/images/8/85/Neuro-selected.jpg'}, faded: {src: '/images/d/d3/Neuro-faded.jpg'}},
Psych: {normal: '/images/4/40/Psychiatry-cyan.jpg', selected: '/images/1/10/Psychiatry-selected.jpg', faded: '/images/5/52/Psychiatry-faded.jpg'},
Psych: {normal: {src: '/images/4/40/Psychiatry-cyan.jpg'}, selected: {src: '/images/1/10/Psychiatry-selected.jpg'}, faded: {src: '/images/5/52/Psychiatry-faded.jpg'}},
Endocrinology: {normal: '/images/7/7e/Endocrinology-cyan.jpg', selected: '/images/8/89/Endocrinology-selected.jpg', faded: '/images/5/54/Endocrinology-faded.jpg'},
Endocrinology: {normal: {src: '/images/7/7e/Endocrinology-cyan.jpg'}, selected: {src: '/images/8/89/Endocrinology-selected.jpg'}, faded: {src: '/images/5/54/Endocrinology-faded.jpg'}},
Cardiology: {normal: '/images/4/4c/Cardiology-cyan.jpg', selected: '/images/0/0a/Cardiology-selected.jpg', faded: '/images/e/eb/Cardiology-faded.jpg'},
Cardiology: {normal: {src: '/images/4/4c/Cardiology-cyan.jpg'}, selected: {src: '/images/0/0a/Cardiology-selected.jpg'}, faded: {src: '/images/e/eb/Cardiology-faded.jpg'}},
Pulmonary: {normal: '/images/0/04/Pulmonary-cyan.jpg', selected: '/images/4/45/Pulmonary-selected.jpg', faded: '/images/3/30/Pulmonary-faded.jpg'},
Pulmonary: {normal: {src: '/images/0/04/Pulmonary-cyan.jpg'}, selected: {src: '/images/4/45/Pulmonary-selected.jpg'}, faded: {src: '/images/3/30/Pulmonary-faded.jpg'}},
InfectiousDisease: {normal: '/images/2/27/Infectious-disease-cyan.jpg', selected: '/images/0/09/Infectious-disease-selected.jpg', faded: '/images/c/cd/Infectious-disease-faded.jpg'},
InfectiousDisease: {normal: {src: '/images/2/27/Infectious-disease-cyan.jpg'}, selected: {src: '/images/0/09/Infectious-disease-selected.jpg'}, faded: {src: '/images/c/cd/Infectious-disease-faded.jpg'}},
Pediatrics: {normal: '/images/9/90/Pediatrics-cyan.jpg', selected: '/images/9/9f/Pediatrics-selected.jpg', faded: '/images/8/8a/Pediatrics-faded.jpg'},
Pediatrics: {normal: {src: '/images/9/90/Pediatrics-cyan.jpg'}, selected: {src: '/images/9/9f/Pediatrics-selected.jpg'}, faded: {src: '/images/8/8a/Pediatrics-faded.jpg'}},
EmergencyMedicine: {normal: '/images/1/1a/Emergency-medicine-cyan.jpg', selected: '/images/2/29/Emergency-medicine-selected.jpg', faded: '/images/3/39/Emergency-medicine-faded.jpg'},
EmergencyMedicine: {normal: {src: '/images/1/1a/Emergency-medicine-cyan.jpg'}, selected: {src: '/images/2/29/Emergency-medicine-selected.jpg'}, faded: {src: '/images/3/39/Emergency-medicine-faded.jpg'}},
ENT: {normal: '/images/3/3e/Ent-cyan.jpg', selected: '/images/8/8a/Ent-selected.jpg', faded: '/images/6/65/Ent-faded.jpg'}
ENT: {normal: {src: '/images/3/3e/Ent-cyan.jpg'}, selected: {src: '/images/8/8a/Ent-selected.jpg'}, faded: {src: '/images/6/65/Ent-faded.jpg'}}
};
};
loadImg = new Image(); for(var chapter in imageObj) {for(var type in chapter){loadImg[chapter][type].src = imageObj[chapter][type]}}


$(".bookChapter").mouseover(function() {
$(".bookChapter").mouseover(function() {
Line 37: Line 35:
if(chapter == selected) {
if(chapter == selected) {


srcLink = imageObj[chapter].selected
srcLink = imageObj[chapter].selected.src


} else {
} else {


srcLink = imageObj[chapter].faded
srcLink = imageObj[chapter].faded.src


}
}
Line 54: Line 52:
var chapter = $(this).attr('id');
var chapter = $(this).attr('id');


srcLink = imageObj[chapter].normal;
srcLink = imageObj[chapter].normal.src;
$(this).attr('src',srcLink);
$(this).attr('src',srcLink);
});
});

Revision as of 18:54, 10 November 2014

 Dynamic Bookshelf on Wikidoc