Widget:Bookshelf: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 11: | Line 11: | ||
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'}}, | 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: {src: '/images/f/fa/Oncology-cyan.jpg'}, selected: {src: '/images/d/d6/Oncology-selected.jpg'}, faded: {src: '/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: {src: '/images/4/4a/Gastroenterology-cyan.jpg'}, selected: {src: '/images/0/06/Gastroenterology-selected.jpg'}, faded: {src: '/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: {src: '/images/0/0b/Nephrology-cyan.jpg'}, selected: {src: '/images/2/23/Nephrology-selected.jpg'}, faded: {src: '/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: {src: '/images/d/dd/Neuro-cyan.jpg'}, selected: {src: '/images/8/85/Neuro-selected.jpg'}, faded: {src: '/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: {src: '/images/4/40/Psychiatry-cyan.jpg'}, selected: {src: '/images/1/10/Psychiatry-selected.jpg'}, faded: {src: '/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'}}, | ||
Line 23: | Line 22: | ||
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'}} | 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'}} | ||
}; | }; | ||
preload(imageObj); | |||
$(".bookChapter").mouseover(function() { | $(".bookChapter").mouseover(function() { | ||
Line 58: | Line 59: | ||
}); | }); | ||
function preload(imageObj) { | |||
$(".bookchapter").attr('visibility','hidden'); | |||
$(".bookChapter").each(function() { | |||
var chapter = $(this).attr('id'); | |||
srcLink = imageObj[chapter].selected.src; | |||
$(this).attr('src',srcLink); | |||
$(".bookChapter").each(function() { | |||
var chapter = $(this).attr('id'); | |||
srcLink = imageObj[chapter].faded.src; | |||
$(this).attr('src',srcLink); | |||
}); | |||
$(".bookChapter").each(function() { | |||
var chapter = $(this).attr('id'); | |||
srcLink = imageObj[chapter].normal.src; | |||
$(this).attr('src',srcLink); | |||
}); | |||
$(".bookchapter").attr('visibility','visibile'); | |||
} | |||
</script> | </script> | ||
<div ID = "Bookshelf" style="height:250px;> | <div ID = "Bookshelf" style="height:250px;> |
Revision as of 19:04, 10 November 2014
Dynamic Bookshelf on Wikidoc