Jump to content

Dynamic Superfish menu options based on browser


sKunKbad

Recommended Posts

I'm trying to pass some options over to the jquery superfish plugin, based on if the browser is IE7 or 8. I've asked elsewhere with no answer, so hoping somebody here can help. In the code below, I want to set animation and speed, but different values if IE7 or 8. Currently it breaks superfish:

 

$(document).ready(function() {
	$('ul.sf-menu').supersubs({
		minWidth:    12,
		maxWidth:    27,
		extraWidth:  1
	}).superfish({
		animation:   (function(){
			if ($.browser.msie && $.browser.version > 6){
				return "{height:'show'}";
			}
			else {
				return "{animation:'show'}";
			}
		}),
		speed:   (function(){
			if ($.browser.msie && $.browser.version > 6){
				return 'fast';
			}
			else {
				return 'normal';
			}
		})
	});
	$('.sf-menu > li a:not(li li a)').css({
		'-moz-border-radius': '3px',
		'-webkit-border-radius': '3px',
		'border-radius': '3px'
	});
});

 

I've been going around in circles with this for an hour or two. Any help is appreciated.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.