Here is my code echo "<td width='$colw%' height='150px' id='tddetails' bgcolor = '$bgcolor' align='center' valign = 'top' ><a href = '#' onMouseover = getunit('$unit') onclick = 'showmenu(event,linkset[0])' onMouseout='delayhidemenu()'> $blockno $unitnumber<br></a> </td>"; When the page load all the clickable links are functioning but when I scroll down and click other links below it automatically go to the top of the page instead of showing the expected menu.. Please Help
Try Replace onMouseover = getunit('$unit') with onMouseover="getunit('$unit')" no space before or after '=' as well as enquote it. I cant see your javascript, so cant say what might be problem, if above does not work. regards
it's the same.. here is javascript code if it will help.. What I'm thinkin is how to remain it from where I clicked it? function showmenu(e, which, optWidth){ if (!document.all&&!document.getElementById) return clearhidemenu() menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu") menuobj.innerHTML=which menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth menuobj.contentwidth=menuobj.offsetWidth menuobj.contentheight=menuobj.offsetHeight eventX=ie5? event.clientX : e.clientX eventY=ie5? event.clientY : e.clientY //Find out how close the mouse is to the corner of the window var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY //if the horizontal distance isn't enough to accomodate the width of the context menu if (rightedge<menuobj.contentwidth) //move the horizontal position of the menu to the left by it's width menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px" else //position the horizontal position of the menu where the mouse was clicked menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px" //same concept with the vertical position if (bottomedge<menuobj.contentheight) menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px" else menuobj.style.top=ie5? iecompattest().scrollTop+event.clientY+"px" : window.pageYOffset+eventY+"px" menuobj.style.visibility="visible" return false }
Oh oh I got it, replace the code you posted at first post with follwing: Modified: href='#' removed onclick replaced in href property href='javascript:showmenu(event,linkset[0])' I hope it helps. regards
Thanks Vooler I edited href but retained onclick and it's working.. I've another problem this is the array var linkset=new Array() //SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT linkset[0]='<a href = "javascript:getlenk()" onMouseout="delayhidemenu()" >Hold</a>' linkset[0]+='<a href ="#" onMouseout="delayhidemenu()">Terms of Payment</a>' linkset[0]+='<a href ="#" onMouseout="delayhidemenu()">Unit Details</a>' What I wanted to happen is when I click the link it will open to another page with content but it shows blank page.. I use target = "_blank"
I think the problem is, you leave extra spaces before and after propery assignment. It must be strict Right one: href="something" Wrong one: href = "something" Fix them and let me know please. Secondly the page you are calling, does that have contents surely ? regards
ok I'll fix it.. currently that's the code.. and it's working and page has content when load with the same page