I'm using Jquery 3.1.1. My code works fine on desktop and Chrome Android, but doesn't work at Firefox Android.
$('.menu').on('click', function() {
$('.aside').addClass('slide-in');
});
Making 'click touchstart' doesn't help, even causes more problems as on Crhome it makes two "touches" instead of one
Related
$('.sceneThumb').draggable({
drag: function(event, ui) {
}
});
A simple draggable event like this is not recognised by chrome after chrome updates (current v90). I have tested on chrome v87 and firefox, they all works fine. I have seen posts about removing adBlock extension in chrome, I tried that and no effect too. Anyone can helps me?
ThereĀ“s a question asking for the same, but it doesn't have a satisfactory answer as I already tried it.
This is my code:
$(window).on("focus", function() {
doSomeFunction();
alert("I am here!");
});
I'm using window because document wasn't working even on chrome desktop, someone suggested using window here in stackoverflow and it works on desktop at least, but in chrome mobile is another case.
With firefox mobile I can switch tabs, press home and reopen firefox, press home, swipe close and reopen firefox and I get the alert message, with chrome none of those cases work.
Need to find a way to make it work on that browser, remember, it works on chrome and firefox desktop and firefox mobile but not on chrome mobile.
Thanks in advance
Got a solution, it's probably not the best but it works.
Aparently chrome mobile is not catching this event when is placed on .js files
so I just have to place it on a tag in my html document:
<script>
$(window).on("focus", function() {
doSomeFunction();
alert("I am here!");
});
</script>
In this case, it doesn't matter if doSomeFunction() is in the DOM or in a .js file, just make sure the focus event is in the DOM
I have write code to change color at run time using Javascript. It work well on Desktop and Andriod Mobile Phones but It is not working on IPhone 5 and 6, I have also tested with Safari in Desktop it works fine on Desktop Safari but not works in Iphone Safari.
Thanks
You get Scripterrors when clicking the buttons:
Uncaught TypeError: undefined is not a function (index):181
document.getElementById("logoimg")
does not return an element as there is none with this id.
If you fix this it may will work :)
It seems to work on my iPhone 6, the page didn't crash or throw an error. have you made sure that JavaScript is turned on in the Safari settings of your phone? It's Settings > Safari > Advanced and theres a toggle switch for turing JavaScript on or off.
you probably have to toggle javascript on your iphone in settings... have you tried with a third party browser like chrome on your iPhone? did it work?
As mentioned I'm using latest version of jQuery.
I simply call
$('table').on('click', 'tr', function() {
alert('click');
});
It runs well on every browser except IE8 (not tested on IE7).
Note I'm running Windows on Parallels Desktop on my iMac.
The crash has something to do with mshtml.dll as reported by IE8 Crash dialog box.
Any advice?
Check the jsFiddle here: http://jsfiddle.net/powtac/kuht6/4/
is working fine here something else could be wrong
http://jsfiddle.net/5Hhmg/
Very simple jQuery doesn't work in Safari for iPhone and iPod touch. I make a simplified case:
$(function(){
$("#boto").click(function() {
$("#boto2").fadeOut("slow");
});
})
http://jsfiddle.net/vWfNj/
http://www.mig-marketing.com/proves2/3.html
It works in computers, it works in iPad but not in my iPod touch. I'm so surprised, I don't understand. Does jQuery needs anything special for Safari in iPhone?
The iphone doesnt have a click event, it has a touch event try this.
$('.class').bind('touchend', function () {
//Code
});
Edit : No idea what your comment means but here....
$(function(){
$("#boto").bind('touchend', function () {
$("#boto2").fadeOut("slow");
});
})
Be aware that on iOS 5, your #boto has to be inserted into the DOM before you attach event handlers to it. I had a similar problem a few days ago : jQuery events on iOS 5
try using .touch instead of .click as a touch event is fired when you click on Any touch supporting device.
I found out that the only problem is with the hosted jQuery library from Google. I don't understand why my iPod touch can download the page but not the jQuery library. I don't know if it is a problem in all iPhones and iPod touch...
Anyway If I download the jQuery library, it works fine. And of course the click function works in the iPhone.