Forum Moderators: open

Message Too Old, No Replies

Pop up menu when mouseover an image

Display menu when mouse move on that image

         

vanik

11:59 am on Jun 18, 2008 (gmt 0)

10+ Year Member



Could any body know how to display popup menu when mouse moving on that.

developnew

11:54 am on Jun 19, 2008 (gmt 0)

10+ Year Member



Hi Vanik,

Use following code

function getClientCenterX() {
return parseInt(getClientWidth()/2)+getBodyScrollLeft();
}

function getClientCenterY() {
return parseInt(getClientHeight()/2)+getBodyScrollTop();
}
function getClientWidth() {
return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}

function getClientHeight() {
return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}

function getBodyScrollTop() {
return self.pageYOffset ¦¦ (document.documentElement && document.documentElement.scrollTop) ¦¦ (document.body && document.body.scrollTop);
115}

function getBodyScrollLeft() {
return self.pageXOffset ¦¦ (document.documentElement && document.documentElement.scrollLeft) ¦¦ (document.body && document.body.scrollLeft);
}

function hidden(id) {
document.getElementById('price').value = '';
document.getElementById('info').innerHTML = '';
document.getElementById(id).style.display = 'none';
document.getElementById('iframe').style.display = 'none';
}

function showpopup(id,tml_id) {
template_id = tml_id;
document.getElementById(id).style.top = getBodyScrollTop()+(getClientHeight()/4);
document.getElementById('iframe').style.top = getBodyScrollTop()+(getClientHeight()/4);
document.getElementById('iframe').style.display = 'block';
document.getElementById(id).style.display = 'block';
document.getElementById('price').focus();
}

U can show the result in templatemonster.com