Permalänk

JavaScript laddning logo

Skickade på ett engelskt forum, orkar inte översätta haha

Hey developers.

I'm going to program a school application for a project in school.
I did have some problems for my design part in my JS.

The idea is that when I start my application a logo will first load before you come to the home page(#page1).

I'm using Div for different pages, I have a page with a logo on it and another page with almost a identical logo but with my name on it.

Here is the JS for loading ONE page in 2 seconds.

$(function() {
setTimeout(hideSplash, 2000);
});

function hideSplash() {
$.mobile.changePage("#page1", "fade");
}

But what I want is to load a page in 0.5 seconds (500 milliseconds) after 0.5 seconds an other page will load for 1.5 seconds. So after a total of 2 seconds (2000 ms) we will come to the startpage (id = page1).

First logo : http://piclair.com/doxyq
Second logo: http://piclair.com/zxx1f

Thanks!

Kind regards, Björn (bear).

Skickades från m.sweclockers.com

Visa signatur

GPU: AORUS GeForce GTX 1080 Ti Xtreme Edition 11G | CPU: Intel Core i7-6700k 4.0 GHz| RAM: HyperX 16 GB 2133 MHz| PCB: MSI Z170A-S02| PSU: EVGA Supernova G2 750 W | Monitor: Acer 27" Predator XB271HU G-Sync IPS| Hörlurar: AKG K7XX | Mick: ModMic v5

Permalänk
Medlem

$(function() { setTimeout(hideSplash1, 500); }); function hideSplash1() { $.mobile.changePage("#page1", "fade"); setTimeout(hideSplash2, 1500); } function hideSplash2() { $.mobile.changePage("#page2", "fade"); }

Något sådant kan ju fungera. Finns säkert en bättre lösning men du har något att börja med i alla fall

Permalänk

Fixade det,

$(document).ready(function(){
$(".logo1").css("display", "none");
$(".logo2").css("display", "none");
$(".logo1").fadeIn(500);
$(".logo1").delay(500).fadeOut(500);
$(".logo2").delay(1500).fadeIn(500);
$(".logo2").delay(500).fadeOut(500);
window.setTimeout(function(){
$("#page1").delay(3000).fadeIn(4000);
$.mobile.changePage ($("#page1"))

}, 3000);

Gjorde en page för båda bilderna med två divs med två bilder på och delay etc på de. Därefter changePage..

Visa signatur

GPU: AORUS GeForce GTX 1080 Ti Xtreme Edition 11G | CPU: Intel Core i7-6700k 4.0 GHz| RAM: HyperX 16 GB 2133 MHz| PCB: MSI Z170A-S02| PSU: EVGA Supernova G2 750 W | Monitor: Acer 27" Predator XB271HU G-Sync IPS| Hörlurar: AKG K7XX | Mick: ModMic v5