any way to change templates depending on the user's browser? - Joomla! Forum - community, help and support
hi all!
since ie poorly constructed in every way should not surprised site looks different in ie in firefox. best way round myriad of problems ie throwing me write separate template css. need know is: there way (i'm thinking plugin of kind) site scan user's browser , assign template user's session, depending on browser they're using?
many thanks
sam
since ie poorly constructed in every way should not surprised site looks different in ie in firefox. best way round myriad of problems ie throwing me write separate template css. need know is: there way (i'm thinking plugin of kind) site scan user's browser , assign template user's session, depending on browser they're using?
many thanks
sam
here little javascript detect browser type: (call ie.js)
then, in template, make call these , conditionally load style sheet, this:
code: select all
<script type="text/javascript">
<!--//--><![cdata[//><!--
sfhover = function() {
var sfels = document.getelementbyid("nav").getelementsbytagname("li");
for (var i=0; i<sfels.length; i++) {
sfels[i].onmouseover=function() {
this.classname+=" sfhover";
}
sfels[i].onmouseout=function() {
this.classname=this.classname.replace(new regexp(" sfhover\\b"), "");
}
}
}
if (window.attachevent) window.attachevent("onload", sfhover);
//--><!]]>
</script>
then, in template, make call these , conditionally load style sheet, this:
code: select all
<!--[if lte ie 7]>
<link href="<?php echo $mosconfig_live_site;?>/templates/<?php echo $mainframe->gettemplate(); ?>/css/template_ie.css" rel="stylesheet" type="text/css" />
<![endif]-->
Comments
Post a Comment