[Greasemonkey] Greasemonkey, Gmail, and z-order...

Chad Bailey chadbailey at gmail.com
Tue Feb 28 08:56:03 EST 2006


(Sorry, I accidentally posted this to the online archive before I was fully
subscribed to the mailing list...)

Howdy everybody... this is my first post to this list, but I've been working
with Greasemonkey, Javascript and CSS for several weeks now on some pretty
heavy Gmail scripting.  I'm almost done, but I've got one pesky little
problem.

Those of you that know Gmail know that when you apply a label to a message,
it appears right before the subject of the message in the 'list view.'  I'm
trying to move those labels so that they're right-justified, just before the
message date.  That way, the labels will still be displayed, but the subject
lines of all of the messages will line up and be easier to read (in my
opinion).  Here's the rendered HTML of a table row containing a message:



<td>
<span class="ct"> Label name is here </span>
Subject of the message
<span class="p"> - This is the gmail 'snippet' text where it shows the first
line or so of the message in grayed-out font... </span>
</td>

<td>   </td>

<td>
<span id="_date_Sun Feb 19 2006_11:12 AM"> Feb 19 </span>
</td>


As you can see, the label is contained in a "ct"-class span.  I tried using
a CSS stylesheet add-on to add "float: right" to the .ct class.  This put
the label exactly where I wanted it... but I couldn't get the z-index
property to function correctly.  The label was always underneath the message
subject or snippet.  I tried adding "z-index: 10", "z-index: 50", "z-index:
99999999", and so on, but no luck.  I also tried adding a lower "z-index" to
the .p class; again, nothing.

I think it has to do with the fact that the subject and snippet appear after
the label span in the DOM, which means that they would by default have a
higher z order, but I thought I could override that with the z-index.  I was
hoping to be able to do this all in CSS to avoid some nasty Javascript.  Any
ideas?

If necessary, I could provide a full sample script for troubleshooting.
Thanks in advance, everyone!


More information about the Greasemonkey mailing list