Javascript functions and IE error addEventListener JQuery -


internet explorer last version show ugly alert addeventlistener, reading fixes here in case believe solution delete part of javascript code giving me problems 0 left javascript.

here code , sure code has 2 or more funtions. first 1 drop down menu using jquery. seems last part addeventlistener maybe not necessary make drop down menu works. got drop down menu website buyed pre-made lots of funtions

lmenu=$(".menu>ul>li");lmenu.find("ul").siblings().addclass("hasul").append('<span class="hasdrop iconoflecha icono-flecha"></span>');lmenulink=lmenu.find("a").not(".submenu a");lmenulinkall=lmenu.find("a");lmenusublink=lmenu.find(".submenu a").not(".submenu li");lmenucurrent=lmenu.find("a.current");if(lmenulink.hasclass("hasul")){$(this).closest("li").addclass("hassub")}lmenulink.click(function(a){$this=$(this);if($this.hasclass("hasul")){a.preventdefault();if($this.hasclass("drop")){$(this).siblings("ul.submenu").slideup(250).siblings().toggleclass("drop")}else{$(this).siblings("ul.submenu").slidedown(250).siblings().toggleclass("drop")}}});lmenusublink.click(function(a){$this=$(this);if($this.hasclass("hasul")){a.preventdefault();if($this.hasclass("drop")){$(this).siblings("ul.submenu").slideup(250).siblings().toggleclass("drop")}else{$(this).siblings("ul.submenu").slidedown(250).siblings().toggleclass("drop")}}});if(!("boxshadow" in document.body.style)){document.body.setattribute("class","noboxshadow")}document.body.addeventlistener("click",function(b){var a=b.target;if(a.tagname==="input"&&a.getattribute("class").indexof("liga")===-1){a.select()}});(function(){var e=document.getelementbyid("fontsize"),d=document.getelementbyid("testdrive"),c=document.getelementbyid("testtext");function b(){d.innerhtml=c.value||string.fromcharcode(160);if(window.icomoonliga){window.icomoonliga(d)}}function a(){d.style.fontsize=e.value+"px"}e.addeventlistener("change",a,false);c.addeventlistener("input",b,false);c.addeventlistener("change",b,false);a()}()); 

i have fiddle javascript code easier read code.

https://jsfiddle.net/epo5es5n/1/

edit: don't know javascript code starts , ends. need make lmenu works dropdown ul li menu only

ie browsers ie8 not support addeventlistener (i'm assuming meant latest version you have when said internet explorer last version). attachevent ie equivalent (well, not equivalent).

if target browser ie8, can replace addeventlisteners attachevent calls, better option (seeing seem have jquery) have change these jquery .bind (or .on if have later version of jquery)


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -