sIFR element with class - sifr

I'm having difficulty with sIFR 3. I am creating some pagination. I would like the element with an 'active' class to be a different color. This is not working. The rest of the code is working fine including the rollover color.
Here's my code. If anything is out of place please let me know.
sIFR.replace(uni, {
selector: 'div.pag_holder',
css: [
'.sIFR-root { background-color: #DEDEDE; }'
,'a.active { color:#000000; }'
,'a { text-decoration:none; color:#1c4382; }'
,'a:hover { cursor:pointer; color:#000000; }'
]
});
I've tried playing around with the order of those anchors, but to no avail.

We had a similar problem where sIFR doesn't implement the value given in a class when the element style has also been specified. The answer was to use two classes for the anchor element. So you could try:
sIFR.replace(uni, {
selector: 'div.pag_holder',
css: [
'.sIFR-root { background-color: #DEDEDE; }'
,'.navLinkActive { color:#000000; }'
,'.navLink { text-decoration:none; color:#1c4382; }'
,'a:hover { cursor:pointer; color:#000000; }'
]
});
Hope this helps.

Related

Add css when #media print using less mixin and guard expressions

I want to avoid duplication in my code. Is it possible to write something like this in LESS?
.print when (#media print = true) {
background: #heading-background-color !important;
-webkit-print-color-adjust: exact;
}
.header-month {
.print
background: #heading-background-color;
font-weight: bold;
}
Instead of:
#media print {
.header-month {
background: #heading-background-color !important;
-webkit-print-color-adjust: exact;
}
}
.header-month {
background: #heading-background-color;
font-weight: bold;
}
It doesn't look like an improvement here. But I'm working with multiple classes and need to do this for all of them.. So maybe an alternative if this is not possible?
Less #media can be nested in a rule so you can define such .print mixin as:
.print() {
#media print {
background: #heading-background-color !important;
-webkit-print-color-adjust: exact;
}
}
// usage:
.header-month {
.print();
background: #heading-background-color;
font-weight: bold;
}
Also see "Passing Rulesets to Mixins" for a more complex stuff.

sIFR links are not visible

I'm trying to get a link in a truetype fornt with sIFR3. It's working fine for all ordinary <h1> and <h2> items, but not for links within a <h2>. sIFR is replacing the <a> correctly, but the result is invisible. When I click the area where the text should be, it follows the link. Even with a pointer cursor. But where's my text?
Replacer:
sIFR.replace(vagroundbtf, {
selector: '#summary_normalx h2'
, css: [
'.sIFR-root { color:#000000; font-weight : bold;} a {color:#333333; text-decoration: none;} '
]
,wmode: 'transparent'
});
HTML-snippet:
<div id="summary_normal">
<div id="article_92" class="entry clearing">
<div id="summary_normalx">
<h2>
This is the title
</h2>
:
BTW: when I remove the css-clause, links are visible in the right font but in default look (blue underlined).
Any ideas?
Roel
try this:
sIFR.replace(vagroundbtf, {
selector: '#summary_normalx h2'
, css: [
'.sIFR-root { color:#000000; font-weight : bold;}',
'a {color:#333333; text-decoration: none;}'
]
,wmode: 'transparent'
});
btw. I do prefer Cufón over sIFR nowadays

sIFR 3 and Links: can't get them to work together

I am trying to use font replacement for my links, but have no idea how to do it.
My test site is http://www.internetlinked.com/test/ how do I setup sifr-config.js so that the links on the left have their fonts replaced. I go it to work using
sIFR.replace(decade, {
selector: 'li',
css: '.sIFR-root { background-color: #1A171B; }'
});
But then I lost all the hover affects and borders
using
sIFR.replace(decade, {
selector: 'a',
css: '.sIFR-root { background-color: #1A171B; }'
});
results in the replacement but the links don't work
I am using sIFR 3
Your first approach is correct. You can style the link by adding rules to the sIFR CSS:
sIFR.replace(decade, { selector: 'li', css: '.sIFR-root { background-color: #1A171B; } a { color: #FF9900; a:hover { color: #FF0000; }' });
Borders and such would be trickier, since Flash doesn't natively support these. Looking at your design, I would not recommend using sIFR for the links in the sidebar.

SIFR 3 NOT RENDERING IE7

I am building a site right now using the new siFR3 it works perfectly on FF & Chrome but not on IE7 to view click here
Try fixing the errors: Here and see if that helps.
Making sure your site is W3C compliant can be a major help in fixing troublesome quirks.
Make sure there is no trailing comma before a closing brace in the config. These are illegal in IE's JavaScript engine.
ok I found out what was the problem all it was watch my old code that doesn't work in IE:
sIFR.replace(officinaWhite, {
selector: '#boxes h1', wmode: 'transparent',
css: '.sIFR-root { color:#ffffff; }',
});
sIFR.replace(officina, {
selector: '#content h2, #rightCol2 h2, #rightCol h2', wmode: 'transparent',
css: '.sIFR-root { color:#000000; }',
});
and this is the code that fixed it:
sIFR.replace(officinaWhite, {
selector: '#boxes h1', wmode: 'transparent',
css: ['.sIFR-root { color:#ffffff; }']
});
sIFR.replace(officina, {
selector: '#content h2, #rightCol2 h2, #rightCol h2', wmode: 'transparent',
css: ['.sIFR-root { color:#000000; }']
});
it is only missing the parenthesis under the css:['.sIFR-root { color:#000000; }'] no commmas in the end.

sIFR onReplacement example

Can someone show me the proper way to invoke the onReplacement callback within sIFR.replace?
Here's my current sIFR.replace method call:
sIFR.replace(mainNavFont, {
selector: 'a.nav-item',
css: '.sIFR-root { color: #ffffff; cursor:pointer;}',
wmode:'transparent',
fitExactly: true,
tuneWidth:10,
offsetLeft: 5,
forceSingleLine: true
});
Like this:
sIFR.replace(mainNavFont, {
selector: 'a.nav-item',
css: '.sIFR-root { color: #ffffff; cursor:pointer;}',
wmode:'transparent',
fitExactly: true,
tuneWidth:10,
offsetLeft: 5,
forceSingleLine: true,
onReplacement: function(fi) {
// Movie has been replaced
}
});
Also, you'll find that replacing the <a> directly will break the links in most browsers. You have to replace the parent element such that the link ends up inside the Flash movie.

Resources