PDA

View Full Version : any link css menu script



ronnmachio
03-29-2006, 06:37 PM
hey guys am a newbie here and to design so I hope you dont hold that aganist me when I ask stupid questions. I tried to get this script to work with what I have but no luck please tell me what am doing wrong, am used yahoo sitebuilder which is a WYSIWYG to create the nav bars the code looks like this for them.
name=nav1.nav
assetID=%NavbarAsset:/navigation_bars/nav1.nav
$--><!--$begin exclude$--><table border="0" cellspacing="0" cellpadding="0"><tr><td><a href="index.html" onMouseOver="document.images['i0'].src='sitebuilder/images/nav1-0-mouseOver-03618.png'" onMouseOut="document.images['i0'].src='sitebuilder/images/nav1-0-active-03528.png'"><img name="i0" src="sitebuilder/images/nav1-0-active-03528.png" width="100" height="27" border="0" alt=""/></a></td><td><a href="investment.html" onMouseOver="document.images['i1'].src='sitebuilder/images/nav1-1-mouseOver-03808.png'" onMouseOut="document.images['i1'].src='sitebuilder/images/nav1-1-inactive-03688.png'"><img name="i1" src="sitebuilder/images/nav1-1-inactive-03688.png" border="0" width="100" height="27" alt=""/></a></td><tr></table><!--$end exclude$--></td>
and

name=nav2.nav
assetID=%NavbarAsset:/navigation_bars/nav2.nav
$--><!--$begin exclude$--><table border="0" cellspacing="0" cellpadding="0"><tr><td><a href="Mywarning.html" onMouseOver="document.images['i2'].src='sitebuilder/images/nav2-0-mouseOver-12158.png'" onMouseOut="document.images['i2'].src='sitebuilder/images/nav2-0-inactive-12048.png'"><img name="i2" src="sitebuilder/images/nav2-0-inactive-12048.png" border="0" width="100" height="27" alt=""/></a></td></tr><tr><td><a href="Novelty.html" onMouseOver="document.images['i3'].src='sitebuilder/images/nav2-1-mouseOver-12308.png'" onMouseOut="document.images['i3'].src='sitebuilder/images/nav2-1-inactive-12208.png'"><img name="i3" src="sitebuilder/images/nav2-1-inactive-12208.png" border="0" width="100" height="27" alt=""/></a></td></tr></table><!--$end exclude$--></td>
for the second. all am trying to do is make the second nav bar appear on mouseover on the home button and customizing it has really been a challeng fo me, I know basic html and can follow just about any other js or css.
thanks a bunch. anyway the site with the two nav bars is
http://www.ea-warning.com.
I would appreciate any suggestions all, I really need is a sigle drop down menu that appears on mouseover thanks.
p/s: if there is a simpler script please lemme know too

.alias.
03-29-2006, 06:47 PM
First off this isn't a DD script, if it is ive never seen it. Secondly you should read the rules. if it is a DD script sorry an please post a link to the DD script site.

Twey
03-29-2006, 07:06 PM
We can't begin to help you with such malformed code. It seems to contain things parsed by Yahoo SiteBuilder, or a server-side script on Yahoo's servers. I suggest you stop using SiteBuilder and create your site yourself.

ronnmachio
03-29-2006, 07:08 PM
guess here is the script

var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds)
var enableanchorlink=0 //Enable or disable the anchor link when clicked on? (1=e, 0=d)
var hidemenu_onclick=1 //hide menu when user clicks within menu? (1=yes, 0=no)

/////No further editting needed

var ie5=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function showhide(obj, e, visible, hidden){
if (ie5||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie5 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie5 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie5 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function dropdownmenu(obj, e, dropmenuID){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
if (typeof dropmenuobj!="undefined") //hide previous menu
dropmenuobj.style.visibility="hidden"
clearhidemenu()
if (ie5||ns6){
obj.onmouseout=delayhidemenu
dropmenuobj=document.getElementById(dropmenuID)
if (hidemenu_onclick) dropmenuobj.onclick=function(){dropmenuobj.style.visibility='hidden'}
dropmenuobj.onmouseover=clearhidemenu
dropmenuobj.onmouseout=ie5? function(){ dynamichide(event)} : function(event){ dynamichide(event)}
showhide(dropmenuobj.style, e, "visible", "hidden")
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}
return clickreturnvalue()
}

function clickreturnvalue(){
if ((ie5||ns6) && !enableanchorlink) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie5&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function delayhidemenu(){
delayhide=setTimeout("dropmenuobj.style.visibility='hidden'",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

ronnmachio
03-29-2006, 07:17 PM
thanks for the input AM serously considering doing that just figured it would be easier since I have never designed a site from scratch before. but using the WYSIWYG programs do not help much when it comes to coding. do you have any suggestions of what would be the best way to go thanks ronn

Twey
03-29-2006, 07:22 PM
Do it yourself. You can do it in a simple text editor, or use something more powerful like vim (http://www.vim.org/), although it takes a bit of getting used to.

.alias.
03-29-2006, 07:23 PM
If you want to go into proper coding an not these templates and stuff then you have to choices,

1) Free Hosts
2) Paid Hosts

Paid hosts are better as they offer more and better hosting. Less interirence with banners and ads from paid hosts.

But Free hosts can offer good hosting if you find one that siuts you, but most of the time you have to have banners and ads, but if your cheap like me then there ok.

ronnmachio
03-29-2006, 07:36 PM
actually I am hosting my site on yahoo thats why I started using site builder in the first place. They offer some add on features that I could use to enhance my site but its terrible, every time i tried to use a text editor (notepad) i would get an error message when i tried to reopen the page on site builder, I even tried dreamweaver a couple of weeks back but I wasnt that comfortable with it. I bought some software called publisher pro from nova to do some graphic work and it offers web design tools but its also a WYSIWYG format too.