Maybe add curled braces to exclude the error there. Is it allowed to
have the semicolon in front of the "else"? (I always added braces so
I've never cared about that problem...)
Can you access the document.styleSheets[0].disabled property? What value
does "len" have? Try also if (document.styleSheets[0]){alert("Exists");}
> i think there's an error & stopped running when it encountered the
> expression:
>
> "document.styleSheets[0].cssRules"
>
> i cannot tell why - it worked for other sites. anybody has any insight?
If you just need to modify the CSS rules on the page, you can use
GM_addStyle (http://wiki.greasespot.net/GM_addStyle).
--
Michal Wojciechowski
http://odyniec.net/ | http://userscripts.org/users/49673
> Is it allowed to have the semicolon in front of the "else"?
Yes, it is. This is JavaScript, not Pascal :)
> yes i was able to move up the logo
> using GM_addStyle by doing "div.nav-bar { top:144px
> }", this gets rid of a big spaces
> between tabs and the logo. what i
> was able to do before was replacing
> the logo.
Is anything stopping you from using GM_addStyle to also replace the logo?
<div class="yuhead-logo">
<style>
.yuhead-logo
h2{
width:200px;
height:30px;
background-image:url(http://l.yimg.com/a/i/brand/
purplelogo/uh/20/minty/logo-ymail-wh.png);
_background-image:url(http://l.yimg.com/a/i/brand/
purplelogo/uh/20/minty/logo-ymail-wh.ie6.png);}
.yuhead-logo
a{
width:200px;
height:30px; }
.yuhead-logo
div.yuhead-comarketing {
width:200px; }
</style>
<h2>
<a href="http://us.lrd.yahoo.com/
_ylt=AhZnv59vdspPCOmL2qcrfr2huVI6/SIG=11ap1seuq/EXP=1314977732/**http
%3A//mail.yahoo.com/" target="_top">
Yahoo! Mail
</a>
</h2> <!-- comarketing component -->
</div>
i dont quite understand the tag " _background-image:", its a
transparent logo image that overlays a white background
image(specified in "background-image" above it). my goal is to replace
the logo here. what will be the best way to do it? I tried adding a
"div.yuhead-logo.h2" style replacing bg image but that did not work...
On Aug 22, 1:34 am, Michal Wojciechowski <odyn...@odyniec.eu.org>
wrote:
> i dont quite understand the tag " _background-image:", its a
> transparent logo image that overlays a white background
> image(specified in "background-image" above it).
"_background-image" is an Internet Explorer 6 hack. The underscore at
the beginning makes it an incorrect CSS rule and browsers ignore it,
except for IE6, which accepts it. So it's basically a way to use a
different style for IE6 -- in this case, a different background image.
> my goal is to replace
> the logo here. what will be the best way to do it? I tried adding a
> "div.yuhead-logo.h2" style replacing bg image but that did not work...
"div.yuhead-logo.h2" means "a div having two classes, yuhead-logo and
h2", which is not what you want. This should work:
GM_addStyle(".yuhead-logo h2 { background-image: url(whatever); }");
> I tried this for a test -
> GM_addStyle(".yuhead-logo h2 { background-image: url(http://l.yimg.com/
> a/i/identity2/profile_16c.png); }");
>
> still not workin:(
Try with !important, i.e.:
GM_addStyle(".yuhead-logo h2 { background-image:
url(http://l.yimg.com/a/i/identity2/profile_16c.png) !important; }");
> do you know why document.styleSheets[i].cssRules syntax would not
> work, it simply stopped the rest of script on FF 3.6.20 ...would you
> recommend GM_addStyle over that method?
Hard to say without actually debugging the script, but, yeah, I'd say
just go with GM_addStyle, as it is a much simpler method.