Help! jQuery not loading on iPhone - iphone

Hey CodeWarriors, anyone know if on the iPhone in Mobile Safari whether there is a timeout for loading a certain amount of Javascripting/jQuery?? The moving background and the black covering over the heart are not working on the iPhone, but are solid on Firefox and my MacBook Pro's Safari – they don't load:
http://www.zookeeper.com/beyourowncreature/2011
Still working on some things on this site before it launches...
Thanks in advance if you have any ideas.
-Dave

All I can see is an error in your jquery.spritely on line 268, 1st line in the window.Touch clause. el[0] does not exist
activeOnClick: function() {
// make this the active script if clicked...
var el = $(this);
if (window.Touch) { // iphone method see http://cubiq.org/remove-onclick-delay-on-webkit-for-iphone/9 or http://www.nimblekit.com/tutorials.html for clues...
el[0].ontouchstart = function(e) {
$._spritely.activeSprite = el;
};
} else {
el.click(function(e) {
$._spritely.activeSprite = el;
});
}
return this;
},
And as the previous comment says, you have and unmatched tag

Related

Ionic 5 Image Picker crashes in iOS Simulator

I try to simply integrate the image picker in my Tab Page. I have a ion-button which calls the Method chooseImage() on a click.
The Problem ist, that when I start the app in the iOS Simulator, it starts normal, but when I click on the chooseImage Button it crashes in that moment. The Image Picker does not open, it crashes before, directly at the click on the button.... I don't know why. Maybe someone could help me please!
This is the Method:
chooseImage() {
this.options = {
width: 220,
quality: 32,
outputType: 1,
maximumImagesCount: 5
};
this.imageObj = [];
this.imagePicker.getPictures(this.options).then((res) => {
for (var i = 0; i < res.length; i++) {
this.imageObj.push('data:image/jpeg;base64,' + res[i]);
}
}, (error) => {
alert(error);
});
}
Probably you miss NSPhotoLibraryUsageDescription in your Info.plist. You should add this:
<key>NSPhotoLibraryUsageDescription</key>
<string>Some description</string>
Where and how add these lines?
This will be helpful if you use cordova: Add entry to iOS .plist file via Cordova config.xml
If you use capacitor check documentation.

SmartFace show sliderdrawer

I trying to learn SmartFace App Development Platform. I added a SliderDrawer in Page then after I added codes as follows. But this codes not working in OnShow() event. How can I do this? Maybe I can do with write a lot of code. But I want to do without writing a lot of code.
function Page1_Self_OnShow() {
Pages.Page1.SliderDrawer1.show();
}
This is a known issue for Android, it will be fixed.But you can solve the problem until the bug is fixed as follows:
function Page1_Self_OnShow() {
var timeoutID = setTimeout(function () {
setHello();
}, 200);
function setHello() {
Pages.Page1.SliderDrawer1.show();
}
function cancelHello() {
clearTimeout(timeoutID);
}
}

iPhone phonegap image disappearing after the phone sits for some time

I am using phonegap 2.0.0 on iOS and using basically the stock image capture code. After the image is captured it is saved to the phone, the URI is saved to the database along with the rest of the items info and the image is displayed on the page.
All this is working on both iOS and android. The issue is that when the iOS phone is turned off and allowed to sit for a period of time (overnight) the images no longer display. The rest of the data is retrieved from the database and displayed but the images just show a black square where the image should be (indicating the info is still inn the database)
Does iOS rename images after being turned off and allowed to sit for a some time? any suggestions? if the phone is turned off and back on this does not happen.. only after the phone sits for some time...
this seems very relevant...
Capturing and storing a picture taken with the Camera into a local database / PhoneGap / Cordova / iOS
for anybody else having this issue the following code worked for me...
function capturePhoto() {
navigator.camera.getPicture(movePic, onFail,{ quality : 70 });
}
function movePic(file){
window.resolveLocalFileSystemURI(file, resolveOnSuccess, resOnError);
}
function resolveOnSuccess(entry){
var d = new Date();
var n = d.getTime();
var newFileName = n + ".jpg";
var myFolderApp = "myPhotos";
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSys) {
fileSys.root.getDirectory( myFolderApp,
{create:true, exclusive: false},
function(directory) {
entry.moveTo(directory, newFileName, successMove, resOnError);
},
resOnError);
},
resOnError);
}
function successMove(imageUri) {
document.getElementById('smallImage').src = imageUri.fullPath;
//hidden input used to save the file path to the database
document.getElementById('site_front_pic').value = "file://"+imageUri.fullPath;
smallImage.style.display = 'block';
}
function onFail(message) {
alert('Failed to load picture because: ' + message);
}
function resOnError(error) {
alert(error.code);
}

Jquery Mobile flicker/white screen in iPhone

After detail search and googling I finally decide to put my question.
In my JQM web app there are total 4 pages. 2 of them are dynamically populated via Ajax. I have used
$.extend($.mobile, {
defaultPageTransition: 'none'
});
My dynamically populated function is
$.get_detail= function(){
$.ajax({
url: "mypage.cfm",
data: data,
timeout:5000,
cache:false,
type:'GET',
dataType:"html",
success: function(data3) {
//$('#filldiv').empty();
$("#filldiv").html(data3);
$.mobile.changePage('#detailpage');
},
error: function(statusCode, errorThrown)
{
if (statusCode.status == 0)
alert("you are offline");
else
alert("Please try again.");
}
});
}
When I change page flash white screen just like flicer happened but when there is no data fill in div then there is no flicker. I have noticed that, if there is no screen size change then every thing is okay and if screen size change by filling the dynamic content flicker happen
Please help me out to solve this issue. Thank you
Here's what I'm using to disable default transitions:
$(document).on( "mobileinit", function() {
$.mobile.defaultPageTransition = 'none';
});
The newest version 1.4, is also supposed to help with better transitions.

can't tap on item in google autocomplete list on mobile

I'm making a mobile-app using Phonegap and HTML. Now I'm using the google maps/places autocomplete feature. The problem is: if I run it in my browser on my computer everything works fine and I choose a suggestion to use out of the autocomplete list - if I deploy it on my mobile I still get suggestions but I'm not able to tap one. It seems the "suggestion-overlay" is just ignored and I can tap on the page. Is there a possibility to put focus on the list of suggestions or something that way ?
Hope someone can help me. Thanks in advance.
There is indeed a conflict with FastClick and PAC. I found that I needed to add the needsclick class to both the pac-item and all its children.
$(document).on({
'DOMNodeInserted': function() {
$('.pac-item, .pac-item span', this).addClass('needsclick');
}
}, '.pac-container');
There is currently a pull request on github, but this hasn't been merged yet.
However, you can simply use this patched version of fastclick.
The patch adds the excludeNode option which let's you exclude DOM nodes handled by fastclick via regex. This is how I used it to make google autocomplete work with fastclick:
FastClick.attach(document.body, {
excludeNode: '^pac-'
});
This reply may be too late. But might be helpful for others.
I had the same issue and after debugging for hours, I found out this issue was because of adding "FastClick" library. After removing this, it worked as usual.
So for having fastClick and google suggestions, I have added this code in geo autocomplete
jQuery.fn.addGeoComplete = function(e){
var input = this;
$(input).attr("autocomplete" , "off");
var id = input.attr("id");
$(input).on("keypress", function(e){
var input = this;
var defaultBounds = new google.maps.LatLngBounds(
new google.maps.LatLng(37.2555, -121.9245),
new google.maps.LatLng(37.2555, -121.9245));
var options = {
bounds: defaultBounds,
mapkey: "xxx"
};
//Fix for fastclick issue
var g_autocomplete = $("body > .pac-container").filter(":visible");
g_autocomplete.bind('DOMNodeInserted DOMNodeRemoved', function(event) {
$(".pac-item", this).addClass("needsclick");
});
//End of fix
autocomplete = new google.maps.places.Autocomplete(document.getElementById(id), options);
google.maps.event.addListener(autocomplete, 'place_changed', function() {
//Handle place selection
});
});
}
if you are using Framework 7, it has a custom implementation of FastClicks. Instead of the needsclick class, F7 has no-fastclick. The function below is how it is implemented in F7:
function targetNeedsFastClick(el) {
var $el = $(el);
if (el.nodeName.toLowerCase() === 'input' && el.type === 'file') return false;
if ($el.hasClass('no-fastclick') || $el.parents('.no-fastclick').length > 0) return false;
return true;
}
So as suggested in other comments, you will only have to add the .no-fastclick class to .pac-item and in all its children
I was having the same problem,
I realized what the problem was that probably the focusout event of pac-container happens before the tap event of the pac-item (only in phonegap built-in browser).
The only way I could solve this, is to add padding-bottom to the input when it is focused and change the top attribute of the pac-container, so that the pac-container resides within the borders of the input.
Therefore when user clicks on item in list the focusout event is not fired.
It's dirty, but it works
worked perfectly for me :
$(document).on({
'DOMNodeInserted': function() {
$('.pac-item, .pac-item span', this).addClass('needsclick');
}
}, '.pac-container');
Configuration: Cordova / iOS iphone 5