Function doesn't work in browser and android browser - javascript

I have code what should detect mobile devices and do my code, if it mobile device (below regex) which contain cookie check and if it absent popup div with buttons which gives cookie when clicked.
But in mobile browser (android) and firefox when i click on button which should give cookie and hide div NOTHING HAPPENS. But in jsfiddle function which hide div works fine, in browser on my site - no. Yep i have jquery included in my page. I'm dissapointed, please help. I'm new in JS and sorry for my english
Function for hide div
hide_ask_div = function(){
$('#ask-user').hide();
}
jsfiddle with mobile devices check
jsfiddle with no mobile devices check, just for test

Related

JQuery .ready when clicking browser back button - desktop browsers vs IPad browsers

I have this simple code on a page
$(document).ready(function () {
alert(“works”);
});
Then I go to the next page, I click in the browser back button and it doesn’t fire the $(document).ready, but if I return to previous page by a link it does.
Tested on desktop browsers and no problem but doesn’t work on Safari or Chrome on IPad
Any idea?
Thanks in advance

How to give focus to a text box on page load for Safari mobile?

Is there a way to give focus to a text box on page load for Safari mobile (Ipad)? If not, would using Chrome for IOS work for this, or is it an IOS feature that prevents this, and not Safari?

$ionicModal focusFirstInput not working on ios devices

I am using angularjs and ionic framework for html5 mobile app. The scenario is when user clicks the search box on main page. A modal should load up autofocusing the searchbox input field and cancel button inline. Also when the searchbox in Modal autofocuses on input field, it should also open up the ios keyboard.
Right now what is happening is when I click on searchbox on main page, it opens up the modal with search header and cancel button and also autofocuses on search input field.It is working fine on desktop view. But the autofocus feature is not working properly on ios devices and also the keyboard doesn't pop-up when modal loads up.
Acc. to ionic docs http://ionicframework.com/docs/api/controller/ionicModal/ I am using
focusFirstInput: true
for autofocus to work.
Here is the plunker sample that I created which works fine on desktop but not on iphone 4 and 5.
Please, Let me know how can I make this work on ios and android devices.
Also, as a side question, if anyone knows about a good chrome or safari pluggin to test the application for mobile devices that will be helpful. I know in chrome we can use their emulate feature to test the responsive designs but what pluggin to use if we want to fully test the mobile application.

Fancybox Dialog Not Working on iPad

Reference web site: http://www.doneupsalon.com
Fancybox 2 works fine on Safari and other modern browsers. However, when viewing on the iPad and clicking a menu link (i.e. Services) the overlay appears (screen dims) but the dialog does not appear. Did I miss a configuration setting? Thanks in advance for your help.

iPhone / iPad disables interaction with links after Javascript scroll on page

I am using a Javascript to have a link in my fixed header scroll the view down to a certain place on the page. Just an animated scroll basically.
When the page loads, all is fine and the link scrolls the page down. From then on, the buttons in the header do not work until the page in manually scrolled, even a tiny amount, by the user. After the content had been moved by the user, all the buttons work again.
Works as expected on Windows 7 using IE9, Chrome, FF, Safari and Opera; fails on Samsung GT-I9000 Android 2.6.32.9; fails on iPad and iPhone with iOS 5.1.1.
Any ideas? Thanks.

Categories