Hello everyone (sorry my English is not perfect),
I make a website with JavaScript (jQuery) but I have one line not working on my iPhone and my iPad.
I write: window.scrollTo(0,document.body.scrollHeight);
It's better on my website but on my devices its not running.
Would you know a functional equivalent of this function?
Thanks!
Related
i want to display a button only on mobile and desktop devices. if user is using application on tablet device i dont want to display the button using react and typescript.
below is my code,
function Parent() {
return(
<button>hide me </button>
);
}
I am new to programming. could someone help me with this. thanks.
Typically this is done using CSS media queries, I recommend going that route. If that isn't useful you can also checkout this answer on a similar question Detect if device is tablet.
There are already libraries to do that for you, you could check this one:
https://www.npmjs.com/package/react-device-detect
I don't think it is quite possible to do this especially as a beginner.
I'm barely an amateur in coding and I know you can check for the screen width or whether it is a device with a touchscreen, but recognizing if the user is using a tablet is not possible to do it with some simple codes.
I have got a website that runs on php, javascript,and html. Im hopping there is a way to stop the mobile device (tablets, android and ios) from going to sleep.
I have done some research on this but they are not very helpful.
I have tried NoSleep.js and the answer from This answer from SO but they all seems not working, my android (ver 6.0) would still go to sleep and my iphone 6s goes to sleep too.
Any solutions?
Edit: For performance I prefer not to have an invisible video or audio playing in the background
Making my first Adobe Air app and was wondering if their was a fullscreen tag or javascript function to make the app fullscreen? I'm using HTML etc, not Flash.
Since it is an Air application, you can control the fullscreen very well with the action script.
Please go through the StageDisplayState class for more information or just visit this link as mentioned by evan
Here you can find an explanation and a file:
http://cookbooks.adobe.com/post_Using_the_FullScreen_functionality_in_AIR-8004.html
http://cookbooks.adobe.com/index.cfm?event=getFile&fileId=3604
I am building a simple app for the iPad. As it is easier, I decided to go with HTML and a little bit of JavaScript, but I have hit a wall. How I can check in JavaScript if an image (local image) exists?
This might be useful http://www.irt.org/script/52.htm
I'm using jQuery on a client's vCard site - http://chrismward.com/beta - to switch between pages.
It all works great on the computer, but when I try on my iPhone: no dice.
I'm using jQuery 4.0 and here is the only js file I'm using on the site (other than jQuery from the Google CDN) - http://chrismward.com/beta/resource/js/main.js
If anyone can help me, I'd greatly appreciate it.
Thanks,
-Giles
Regular JavaScript animations (using setTimeout/setInterval) don't work very well in Mobile Safari; you need to use CSS Animations to get decent results. You might want to try creating an iPhone-optimised version of the site using jQTouch (which uses CSS animations).
They appear to work fine in the iPhone Simulator. Which means, if they are too slow on an iPhone, they are just too slow. Use CSS animations like Steve Harrison suggests. You probably want the -webkit-transition property. Here's an example you can try.