I attempted to use change slide and enter the slide # to be initiated. It did not work. I tried many different ways to get it to work, debugging my code as I went along. I can mouseOver and mouse out for Slide 1. I did remove the onClick because I found another way to direct the user to make their final selection, but I still have no understanding of changeSlide syntax to have it move to the appropriate slide upon mouseOver of a new designated area.
I finally asked my fiance for help and he wrote this…
Title
#tartanImg {
width: auto;
height: 250px;
z-index: 2;
position: absolute;
display: inline-block;
top: -500px;
left: -500px;
}
var areas = [
{coords: [493,79,518,96,469,166,445,150], img: 'Sinclair.gif', pos: 'SE'},
{coords: [126,123,165,141,174,175,144,200,105,193,97,157], img: 'MacLeod of Lewis.jpg', pos: 'SE'},
{coords: [423,134,458,169,444,184,409,148], img: 'Gunn.gif', pos: 'SE'},
{coords: [494,673,494,705,545,705,545,673], img: 'Scott_red.gif', pos: 'NW'},
{coords: [401,708,401,726,464,726,464,708], img: 'Douglas_black.gif', pos: 'NW'},
];
function showDetail() {
var id = event.target.id.split('_')[1];
var area = areas[new Number(id)];
var img = document.getElementById('tartanImg');
img.src = 'http://www.michelona.com/TartanProject/' + area.img;
if (area.pos == "SE") {
img.style.left = "350px";
img.style.top = "550px";
} else {
img.style.left = "50px";
img.style.top = "50px";
}
}
function clearDetail(pos) {
var id = event.target.id.split('_')[1];
var area = areas[new Number(id)];
var img = document.getElementById('tartanImg');
img.src = 'blank.png';
img.style.left = "-500px";
img.style.top = "-500px";
}
document.addEventListener('DOMContentLoaded', function() {
var map = document.getElementById('cmp');
for (var i = 0; i < areas.length; i++) {
var area = areas[i];
var newArea = document.createElement('area');
newArea.id = 'area_' + i;
newArea.shape = 'poly';
newArea.coords = area.coords.join();
newArea.href = "#";
var pieces = area.img.split('.');
var pieces2 = pieces[0].split('_');
newArea.alt = pieces2[0];
newArea.title = pieces2[0];
newArea.onmouseover = showDetail;
newArea.onmouseout = clearDetail;
map.appendChild(newArea);
}
});
</script>
We decided upon making the map itself interactive and encase it in an iFrame.
Now....the iframe won't work on the live site because it does not have an SSL.
FML...
All I wanted to do is use Wix Code ITSELF to mouseOver each Name and execute a image with text in a container, then disappear with mouseOut, waiting for the next Hover to pop a new image. It sounded simple. I saw the whole process in my mind. Now its much harder, than I anticipated.
I won't give up though.
My question, what harm is an iframe in a sandbox, on an SSL Website going to harm?