Овај сајт ће имати ограничену функционалност док га будемо ажурирали у циљу побољшања вашег искуства. Ако неки чланак не реши ваш проблем и желите да поставите питање, на располагању ће вам бити наше заједнице подршке @FirefoxSupport на Twitter-у и /r/firefox на Reddit-у.

Претражи подршку

Избегните преваре подршке. Никада од вас нећемо тражити да зовете или шаљете поруке на број или да делите личне податке. Пријавите сумњиве радње преко „Пријавите злоупотребу” опције.

Сазнај више

Dropdown menu not working only on firefox http://www.meichipeng.com/portfolio/

  • 7 одговорa
  • 4 имају овај проблем
  • 1 преглед
  • Последњи одговор послао svmeichipeng

more options

I'm trying to find out why the drop down menu on the left hand side not working at all only on FF, working fine on other browsers. Our website is very simple and straight forward coding. Here are our problem pages on the site http://www.meichipeng.com/portfolio/ http://www.meichipeng.com/press/

Thank you

I'm trying to find out why the drop down menu on the left hand side not working at all only on FF, working fine on other browsers. Our website is very simple and straight forward coding. Here are our problem pages on the site http://www.meichipeng.com/portfolio/ http://www.meichipeng.com/press/ Thank you

Изабрано решење

You can try something like this (not tested).

init: function(options) { this.el = options.el; $(this.el).find("span").click(function(event) { Treenav.toggleMenu(event); }); this.restoreMenuState(); }, 

toggleMenu: function(event) {
 if (typeof event == 'undefined') { event = window.event; }
 var _el = event.target||event.srcElement;  //console.log(_el); 

 $(_el).parent().children("ul").slideDown(300);
 $(_el).parent().siblings("li").children("ul").slideUp(300); 
}, 
Прочитајте овај одговор са објашњењем 👍 2

Сви одговори (7)

more options

What programming language was used to make this website?

Firefox has some known HTML5 compatibility issues. If this website is in HTML5 format, then you may experience some issues running the site on Firefox.

more options

How can I find out which version of HTML we used? This website is about 3 years old and I just make some edition and maintain the site, not a programmer. Any suggestion to fix this issue why only happens on FF? Thank you

more options

In Firefox you need to pass the event as a parameter.
Firefox doesn't support window.event

Web Console (Firefox/Tools > Web Developer;Ctrl+Shift+K):

TypeError: window.event is undefined @ http://www.meichipeng.com/js/treenav.js:13
function(event){
if (typeof event == 'undefined') { event = window.event; }
var target = event.target||event.srcElement; 
 ...
}
more options

If you didn't program the website, you would need to contact the person/company that did. Since the website is so old, I doubt that it is an HTML5 page.

The page isn't labeled as an HTML5 page in the !DOCTYPE tag, but it could have been incorrectly labeled.

more options

Where should I specify that function in treenav.js? In init or in toggleMenu? Thank you.

init: function(options) { this.el = options.el; $(this.el).find("span").click(function() { Treenav.toggleMenu(); }); this.restoreMenuState(); },


toggleMenu: function() { _el = window.event.target; if (!_el) { _el = window.event.srcElement; } //console.log(_el); $(_el).parent().children("ul").slideDown(300); $(_el).parent().siblings("li").children("ul").slideUp(300); },

more options

Одабрано решење

You can try something like this (not tested).

init: function(options) { this.el = options.el; $(this.el).find("span").click(function(event) { Treenav.toggleMenu(event); }); this.restoreMenuState(); }, 

toggleMenu: function(event) {
 if (typeof event == 'undefined') { event = window.event; }
 var _el = event.target||event.srcElement;  //console.log(_el); 

 $(_el).parent().children("ul").slideDown(300);
 $(_el).parent().siblings("li").children("ul").slideUp(300); 
}, 
more options

That line is just working perfect! Thank you so much, you saved me. This forum is really great!