473,387 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

CSS positioning pickle

Ok here is the pickle. I have got a navigation menu link list made
from a vertical <ultag. I have a piece of javascript that grabs the
title attribute of each link in the list and displays it as a <span>
inside the link. I am using a bit of CSS to attempt to make it so that
this <spanonly displays on mouseover. This bit working great in
Mozilla but not at all in IE6. What I am trying to figure out (aside
form how to make this work in IE6) is a way to position child elements
in the same space regardless of where thier parents are positioned on
the page. As it is now even if I use absolute position the <span>
appears where it is supposed to but it is offset by whichever link of
the original list the <spanis child to. I would like to have all of
these different <spanbits appear in the exact same place on the page
when you mouseover their parent in the link list. Here is my code so
far.

// HANDLE MULTIPLE LOAD FUNCTIONS
// CALL LOAD FUNCTIONS with addLoadEvent(functionname);
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}

// STRIP TITLE ATTTRIBUTES FROM PRIMARY LINKS AND
// REPURPOSE SAME TEXT AS TRAILING SPAN ELEMENT
// IT EFFECTIVELY TRANSFORMS THIS:
// <ul id="primary">
// <li><a href="?q=" title="Go to the home page">Home</a></li>
// <li><a href="?q=about" title="Learn more about Bethlehem
Lutheran Church">About</a></li>
// </ul>
// INTO THIS:
// <ul id="primary">
// <li><a href="?q=">Home<span>Go to the home page</span></a></li>
// <li><a href="?q=about">About<span>Learn more
about...</span></a></li>
// </ul>
// ON THE FLY WITHOUT HACKING CORE MODULES
function primary_tooltips() {
if ( !document.getElementById ||
!document.createElement ||
!document.getElementsByTagName ) {
return;
}
var primary = document.getElementById('globalnav');
var links = primary.getElementsByTagName('a');
for ( var i = 0; i < links.length; i++ ) {
var tip = links[i].getAttribute('title');
links[i].removeAttribute('title');
var newSpan = document.createElement('span');
var newText = document.createTextNode(tip);
newSpan.appendChild(newText);
links[i].appendChild(newSpan);
}
}
addLoadEvent(primary_tooltips);
</script>

<style type="text/css" media="screen">
#globalnav #sidebar_left ul li a {
position:relative; /*this is the key*/
z-index:24;
}
#globalnav #sidebar_left ul li a:hover {
z-index:25;
}
#globalnav #sidebar_left ul li a span {
/* hide the span */
display: none;
}
#globalnav #sidebar_left ul li a:hover span {
/*the span will display just on :hover state*/
width: 20em;
display:block;
background-color: grey;
color: black;
text-align: left;
position:absolute;
left:300px;
}
#menu-caption {
background-color: #930503;
padding: 4px 5px 2px 5px;
}
/* MENU CONTENT ELEMENTS */

#globalnav {
float: 150px;
padding-bottom: 20px;
padding-right: 10px;
border-right: 1px solid #e6e6e6;
font-family: veranda, sans-serif;
}
#globalnav #sidebar_left ul {
margin: 0;
padding: 0;
text-align: right;
font-size: 14px;
}
#globalnav #sidebar_left ul li {
list-style-type: none;
list-style-image: none;
margin-bottom: 4px;
padding-bottom: 4px;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #E6E6E6;
padding-top: 0px;
padding-right: 0px;
padding-left: 0px;
}
#globalnav #sidebar_left ul li a {
text-decoration: none;
color: #737373;
font-weight: bold;
}
#globalnav #sidebar_left ul li a:hover {
color: #336699;
}
/* subnav */
#globalnav #sidebar_left ul li .menu {
margin-bottom: 2px;
margin-top: 6px;
}
#globalnav #sidebar_left ul li .menu li {
font-size: 12px;
margin-bottom: 6px;
padding-bottom: 0px;
border: none;
}
#globalnav #sidebar_left ul li .menu li a {
color: #8c8c8c;
font-weight: normal;
line-height: 11px;
}
#globalnav #sidebar_left ul .expanded a {
color: #336699;
}
#globalnav #sidebar_left ul li .menu li .active, #globalnav
#sidebar_left ul li .menu li a:hover {
color: #73994c;
}
</style>

<div id="globalnav">

<div class="column" id="sidebar_left">
<div class="block block-user" id="block-user">
<div class="content">
<ul class="menu">
<li class="leaf"><a href="/whats_happening" title=" Description for
what is happening">What's Happening</a></li>
<li class="leaf"><a href="/what_we_offer" title="">What We
Offer</a></li>
<li class="leaf"><a href="/research_education"
title="">Research/Education</a></li>
<li class="leaf"><a href="/workplace" title="">Workplace</a></li>

<li class="collapsed"><a href="/computers"
title="">Computers</a></li>
<li class="leaf"><a href="/support" title="">Support Your
Library</a></li>
<li class="leaf"><a href="/community" title="">Community</a></li>
<li class="collapsed"><a href="/node/add">create content</a></li>
<li class="leaf"><a href="/entertainment"
title="">Entertainment</a></li>
<li class="leaf"><a href="/library_stuff" title="test description
for Library Stuff!">Library Stuff</a></li>
<li class="leaf"><a href="/user/1">my account</a></li>
<li class="expanded"><a href="/admin">administer</a>
<ul class="menu">

<li class="leaf"><a href="/admin/access">access control</a></li>
<li class="leaf"><a href="/admin/aggregator">aggregator</a></li>
<li class="leaf"><a href="/admin/block">blocks</a></li>
<li class="leaf"><a href="/admin/category">categories</a></li>
<li class="leaf"><a href="/admin/node">content</a></li>
<li class="leaf"><a href="/admin/filters">input formats</a></li>
<li class="leaf"><a href="/admin/logs">logs</a></li>
<li class="leaf"><a href="/admin/menu"
class="active">menus</a></li>
<li class="leaf"><a href="/admin/modules">modules</a></li>

<li class="collapsed"><a href="/admin/settings">settings</a></li>
<li class="leaf"><a href="/admin/themes">themes</a></li>
<li class="leaf"><a href="/admin/path">url aliases</a></li>
<li class="leaf"><a href="/admin/user">users</a></li>
<li class="leaf"><a href="/admin/help">help</a></li>

</ul>
</li>
<li class="leaf"><a href="/logout">log out</a></li>

</ul>
</div>
</div>
</div>
</div>


_______________
<div><div><div><div><div><div><div><div><div><div> Have to love code
generated by CMS...

Jul 12 '06 #1
3 1573
kr**********@hotmail.com wrote:
Ok here is the pickle. I have got a navigation menu link list made
from a vertical <ultag. I have a piece of javascript that grabs the
title attribute of each link in the list and displays it as a <span>
inside the link. I am using a bit of CSS to attempt to make it so that
this <spanonly displays on mouseover. This bit working great in
Mozilla but not at all in IE6. [...]

// ON THE FLY WITHOUT HACKING CORE MODULES
function primary_tooltips() {
if (!document.getElementById ||
!document.createElement ||
!document.getElementsByTagName ) { return; }
Have you verified IE is not disappearing here?

An URL would be far more useful than all those code fragments.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 12 '06 #2

kr**********@hotmail.com wrote:
I have a piece of javascript that grabs the
title attribute of each link in the list and displays it as a <span>
inside the link.
Don't. Process this off-line before uploading it.

It's a better solution, and it's also far easier for you to debug its
output.

Jul 12 '06 #3
Joe
In article <11**********************@i42g2000cwa.googlegroups .com>,
kr**********@hotmail.com says...
Ok here is the pickle.
<snip>
>I am using a bit of CSS to attempt to make it so that
this <spanonly displays on mouseover.
Sort of like this? Hover the menu items at

http://members.aardvark.net.au/grakat/

Sorry, no javascript - just html and css. Works in all the better
browsers and IE6.
Jul 14 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Michael Hohn | last post by:
Hi, under python 2.2, the pickle/unpickle sequence incorrectly restores a larger data structure I have. Under Python 2.3, these structures now give an explicit exception from...
0
by: Mike P. | last post by:
Hi all, I'm working on a simulation (can be considered a game) in Python where I want to be able to dump the simulation state to a file and be able to load it up later. I have used the standard...
6
by: Jim Lewis | last post by:
Pickling an instance of a class, gives "can't pickle instancemethod objects". What does this mean? How do I find the class method creating the problem?
10
by: crystalattice | last post by:
I'm creating an RPG for experience and practice. I've finished a character creation module and I'm trying to figure out how to get the file I/O to work. I've read through the python newsgroup...
5
by: Chris | last post by:
Why can pickle serialize references to functions, but not methods? Pickling a function serializes the function name, but pickling a staticmethod, classmethod, or instancemethod generates an...
3
by: fizilla | last post by:
Hello all! I have the following weird problem and since I am new to Python I somehow cannot figure out an elegant solution. The problem reduces to the following question: How to pickle a...
2
by: Michele Simionato | last post by:
Can somebody explain what's happening with the following script? $ echo example.py import pickle class Example(object): def __init__(self, obj, registry): self._obj = obj self._registry =...
2
by: Nagu | last post by:
I am trying to save a dictionary of size 65000X50 to a local file and I get the memory error problem. How do I go about resolving this? Is there way to partition the pickle object and combine...
1
by: IceMan85 | last post by:
Hi to all, I have spent the whole morning trying, with no success to pickle an object that I have created. The error that I get is : Can't pickle 'SRE_Match' object: <_sre.SRE_Match object at...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.