Wednesday 15 July 2015

Javascript mouse events not working in firefox? -


I'm creating a slightly sliding bar at the top of my website, it's considered something like the iOS 5+ notification center slider .

HTML

  & lt; Div id = 'orange' & gt; Change. It does not matter, after that there is no result at the end. A portal for free, Phasellus convallis pregnant and annoying for a portal to free. There is no justification for any time in the Nunam Dissnisim picture Rhesus, there is no justification for any time Anne is not a non-military, how about normal time hostess shows how we know, but it is a good for you The way. Maurice Nek Fellis A. about Phasellus Mix Frysilla Vehicle Nallah Alamkorpar has written about one Magnum. News Ventis Same & Lt; Div class = 'resize' onmousedown = "vertical resize (document.getElementById ('orange'), 6);" & Gt; & Lt; / Div & gt; & Lt; / Div & gt;   

css

  #orange {overflow: hidden; Background color: # ca4d0d; Height: 6px; Status: Relative; } .resize {padding: 0; Height: 6px; Width: 40px; Cursor: Change the N-shape; Status: Completed; Background-color: # 000; Bottom: 0; Left: 50%; Margin: 0-20px; }   

JAVASCRIPT

  Function Vertical Resize (element, minute) {event = event || Window.event; Var Mousetobotm = (element.offsetop + element.offsetHeight) - event.clientY; Document.onmousemove = function (event) {var target = (event.clientY + mouseToBottom) - element.offsetTop; If (target>  Element scrollHeight || element.offsetHeight> element.scrollHeight) {element.style.height = element.scrollHeight + "px"; } And {element.style.height = target + "px"; }} Document.onmouseup = function () {document.onmousemove = null; If (element.releaseCapture) {element.releaseCapture (); }} If (element.setCapture) {element.setCapture (); }}   

The thing is now, as I wanted to do the work I got (I do whatever I can do in Chrome I do the tests unless I am not right Does). Then when I used to work it out of Firefox to check in major browsers (IE, Opera, Safari, Chrome and Firefox). It seems like the events of the mouse are never registered on firefox.

Why is that so? And how do I solve it?

Your event is not defined

Why are you using inline function? I can not see the special reason for this You can handle it in a way that can solve your problem:

  document.getElementsByClassName ('resize') [0] .onmousedown = function (event) {var element = Document.getElementById ('orange'); Var min = 6; // ...};   



No comments:

Post a Comment