I cannot figure out why Safari/Mobile Safari is ignoring a line of code that uses Modernizr's .generatedcontent
rule to hide icons using icomoon. You can view the live site at http://importbible.com/ the icons are on the footer of the page. The browser renders perfectly on Chrome. Did some more testing, Safari 5.1.2 fails while Safari 6.0.1 works. iPad running 4.3 fails. The line in question is:
.generatedcontent .icon-gplus, .generatedcontent .icon-facebook, .generatedcontent .icon-twitter, .generatedcontent .icon-feed, .generatedcontent .icon-youtube, .generatedcontent .icon-flickr, .generatedcontent .icon-deviantart, .generatedcontent .icon-tumblr, .generatedcontent .icon-share, .generatedcontent .icon-tag, .generatedcontent .icon-home, .generatedcontent .icon-news, .generatedcontent .icon-cart, .generatedcontent .icon-cart, .generatedcontent .icon-basket, .generatedcontent .icon-mail, .generatedcontent .icon-clock, .generatedcontent .icon-forward, .generatedcontent .icon-replay, .generatedcontent .icon-chat, .generatedcontent .icon-refresh, .generatedcontent .icon-magnifier, .generatedcontent .icon-zoomin, .generatedcontent .icon-expand, .generatedcontent .icon-cog, .generatedcontent .icon-trash, .generatedcontent .icon-list, .generatedcontent .icon-grid, .generatedcontent .icon-download, .generatedcontent .icon-globe, .generatedcontent .icon-link, .generatedcontent .icon-attachment, .generatedcontent .icon-eye, .generatedcontent .icon-star_empty, .generatedcontent .icon-star_half, .generatedcontent .icon-star, .generatedcontent .icon-heart, .generatedcontent .icon-thumb, .generatedcontent .icon-cancel, .generatedcontent .icon-left, .generatedcontent .icon-right {
display: none !important;
}
Throwing this out there as a debugging option, if nothing else.
Have you tried using a wildcard for .icons
?
[class*='icon-'] { display:none !important }
or
[class^='icon-'] { display:none !important }
EDIT: Friday your page was timing out, so I couldn't view it. Today I'm getting the following errors (Safari 5.1.2/MAC):
And I'm seeing 6 icons under "Connect".
I have no problem browsing to the URL in error line #1 directly (Safari or Chrome).
It looks like <span class="icon-facebook">1</span>
is your backup for browsers that don't support generated content. I would suggest hiding the back-up by default (thru CSS), and letting javascript show your backup icons for browsers that don't support generated content. Either by using Modernizr's "no-generatedcontent" class, or the IE7 javascript file supplied by IcoMoon.
Using Modernizr:
.icon-facebook { display: none; }
.no-generatedcontent .icon-facebook {display: inline; }
Or the lte-ie7.js
file supplied by IcoMoon. Using this method you wouldn't have to use extra markup (just use <span class="icon-facebook-b">
without the backup <span class="icon-facebook">1</span>
).
/* Use this script if you need to support IE 7 and IE 6. */
window.onload = function() {
function addIcon(el, entity) {
var html = el.innerHTML;
el.innerHTML = '<span style="font-family: \'icomoon\'">' + entity + '</span>' + html;
}
var icons = {
'icon-home' : '!',
'icon-home-2' : '"',
'icon-newspaper' : '#',
'icon-pencil' : '$',
'icon-pencil-2' : '%'
},
els = document.getElementsByTagName('*'),
i, attr, html, c, el;
for (i = 0; i < els.length; i += 1) {
el = els[i];
attr = el.getAttribute('data-icon');
if (attr) {
addIcon(el, attr);
}
c = el.className;
c = c.match(/icon-[^\s'"]+/);
if (c) {
addIcon(el, icons[c[0]]);
}
}
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With