Jump to content


I'm so annoyed.


  • You cannot reply to this topic
No replies to this topic

#1 Nike

    Young Padawan

  • Members
  • Pip
  • 204 posts
  • Location:Ohio
  • Interests:Controlling the human and and duck race.

Posted 07 July 2007 - 01:05 AM

On http://www.seven-lab...~nike/piejokes/
If you notice if you hover over Jokes a dropdown comes down. Which is good. Now I am trying to make an extension off the Yomama joke part cause there are so many differnt ones like yomama so fat, short, ugly. You get it.

I can't figure it out though.

Here is my CSS for the menu.

#menu_child {
position: absolute;
visibility: hidden;
background-color: #690;
width: 130px;
border: 1px solid black;
border-bottom-width: 0;
}

#menu_child a {
display: block;
border-bottom: 1px solid black;
padding: 2px;
text-decoration: none;
color: #fff;
background-color: #690;
}

#menu_child a:hover {
color: #000;
background-color: #a4f600;
}

And here is my code for it to show on the page.
<div id="menu_child">
<a href="?page=black">Black</a>
<a href="?page=blonde">Blonde</a>
<a href="?page=ethnic">Ethnic</a>
<a href="?page=gay">Gay</a>
<a href="?page=yomama">Yo mama</a>
</div>
<script type="text/javascript">
at_attach("menu_parent", "menu_child", "hover", "y", "pointer");
</script>
and heres my js.
// <script>




// ----- Popup Control ---------------------------------------------------------

function at_display(x)
{
win = window.open();
for (var i in x) win.document.write(i+' = '+x[i]+'<br>');
}

// ----- Show Aux -----

function at_show_aux(parent, child)
{
var p = document.getElementById(parent);
var c = document.getElementById(child);

var top = (c["at_position"] == "y") ? p.offsetHeight+2 : 0;
var left = (c["at_position"] == "x") ? p.offsetWidth +2 : 0;

for (; p; p = p.offsetParent)
{
top += p.offsetTop;
left += p.offsetLeft;
}

c.style.position = "absolute";
c.style.top = top +'px';
c.style.left = left+'px';
c.style.visibility = "visible";
}

// ----- Show -----

function at_show()
{
p = document.getElementById(this["at_parent"]);
c = document.getElementById(this["at_child" ]);

at_show_aux(p.id, c.id);

clearTimeout(c["at_timeout"]);
}

// ----- Hide -----

function at_hide()
{
c = document.getElementById(this["at_child"]);

c["at_timeout"] = setTimeout("document.getElementById('"+c.id+"').style.visibility = 'hidden'", 333);
}

// ----- Click -----

function at_click()
{
p = document.getElementById(this["at_parent"]);
c = document.getElementById(this["at_child" ]);

if (c.style.visibility != "visible") at_show_aux(p.id, c.id);
else c.style.visibility = "hidden";

return false;
}

// ----- Attach -----

// PARAMETERS:
// parent - id of visible html element
// child - id of invisible html element that will be dropdowned
// showtype - "click" = you should click the parent to show/hide the child
// "hover" = you should place the mouse over the parent to show
// the child
// position - "x" = the child is displayed to the right of the parent
// "y" = the child is displayed below the parent
// cursor - Omit to use default cursor or check any CSS manual for possible
// values of this field

function at_attach(parent, child, showtype, position, cursor)
{
p = document.getElementById(parent);
c = document.getElementById(child);

p["at_parent"] = p.id;
c["at_parent"] = p.id;
p["at_child"] = c.id;
c["at_child"] = c.id;
p["at_position"] = position;
c["at_position"] = position;

c.style.position = "absolute";
c.style.visibility = "hidden";

if (cursor != undefined) p.style.cursor = cursor;

switch (showtype)
{
case "click":
p.onclick = at_click;
p.onmouseout = at_hide;
c.onmouseover = at_show;
c.onmouseout = at_hide;
break;
case "hover":
p.onmouseover = at_show;
p.onmouseout = at_hide;
c.onmouseover = at_show;
c.onmouseout = at_hide;
break;
}
}

If anyone can help me that would be great.

Edited by Nike, 07 July 2007 - 01:15 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users