Responsive drop down menu don't work in Android

More
11 years 1 month ago #34878 by hzarrabi
Hi,

I have similar problem with Samsung S3, when clicking on the menu button, the menu drops down and disappears straight forward.

In this post you gave a solution by changing some part of the code. But it is not clear enough for me.

I put all the code of the file with the change for you here. Could you please tell me if it’s correct like this?

Regards



CODE

function menutransform(){

var topMenuContainerWidth = jQuery("div.cell").has("ul.nav").innerWidth();
var topMenuWidth = jQuery("ul.nav").innerWidth();
jQuery("ul.nav").css("min-width",topMenuWidth);

if(topMenuWidth > topMenuContainerWidth) {

jQuery(".tinynav").css("display","block");
jQuery("ul.nav").css("display","none");

jQuery("ul.nav").tinyNav({
active: 'current', // String: Set the "active" class
header: 'Navigation', // String: Specify text for "header" and show header instead of the active item
});
$.fn.quickChange = function(handler) {
return this.each(function() {
var self = this;
self.qcindex = self.selectedIndex;
var interval;
function handleChange() {
if (self.selectedIndex != self.qcindex) {
self.qcindex = self.selectedIndex;
handler.apply(self);
}
}
$(self).focus(function() {
interval = setInterval(handleChange, 100);
}).blur(function() { window.clearInterval(interval); })
.change(handleChange); //also wire the change event in case the interval technique isn't supported (chrome on android)
});
};
}else{
jQuery(".tinynav").css("display","none");
jQuery("ul.nav").css("display","block");
}
jQuery(document).ready(function(){
$("SELECT.tinynav").quickChange(function() {
jQuery(this).trigger('change');
});

});

}

jQuery(function(){
menutransform();
//jQuery(window).resize(menutransform);
jQuery(window).resize(function(){
jQuery(".tinynav").remove();
menutransform();
});
});

Please Log in to join the conversation.

More
11 years 1 month ago #34889 by ivan.milic
this should go to very bottom:

jQuery(document).ready(function(){
$("SELECT.tinynav").quickChange(function() {
jQuery(this).trigger('change');
});

});

Please Log in to join the conversation.

Time to create page: 0.072 seconds
Powered by Kunena Forum