Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
neownd schrieb:Meines Wissens gibt es so ein simples Script für eine "Modanzeige-Funktion" nirgends zum Download.
<!--webbot bot="HTMLMarkup" startspan --><script language="JavaScript">
<!--
function simpleArray() {
this.length = 0;
this.active = '';
}
function event(type, start, finish, image, link) {
this.type = type;
this.start = start;
this.finish = finish;
this.image = image;
this.link = link;
}
events = new simpleArray();
function addEvent(type, start, finish, image, link) {
events.length++;
if (finish == 000) {
finish = 2400;
}
events[events.length] = new event(type, start, finish, image, link);
}
function setImage() {
today = new Date();
day = today.getDay();
hour =today.getHours();
minute = today.getMinutes();
now = (hour * 100) + minute;
type = 'week';
if (day == 0) {
type = 'sun';
} else if (day == 6) {
type = 'sat';
}else if (day == 1) {
type = 'mon';
}else if (day == 2) {
type = 'tue';
}else if (day == 3) {
type = 'wed';
}else if (day == 4) {
type = 'thu';
}else if (day == 5) {
type = 'fri';
}
for (i=1; i<=events.length; i++) {
if ( (events[i].type == type) && (events[i].start <= now) && (events[i].finish > now) ) {
events.active = i;
eventImage = events[i].image;
if (events[events.active].link != null) {
eventImage = '<A HREF=\"http://www.tornradio.com:8020/listen.pls\">' + eventImage + '</A>';
}
}
}
}
imageCode = '<IMG BORDER=0 SRC=';
addEvent('mon',0000,1900,'Off The Air');
addEvent('mon',1900,2100,'<img src="http://www.tornradio.com/platinum.jpg"><br>Pure Platinum Plus<br>7:00 PM - 9:00 PM ET');
addEvent('mon',2100,2400,'Off The Air');
addEvent('tue',000,1900,'Off The Air');
addEvent('tue',1900,2300,'<img src="http://www.tornradio.com/miketrash.jpg"><br>Trash Talking Radio<br>7:00 - 10:00 PM ET');
addEvent('tue',2300,2400,'Off The Air');
addEvent('wed',000,1900,'Off The Air');
addEvent('wed',1900,2100,'<img src="http://www.tornradio.com/levi.jpg"><br>The Show<br> 7:00 - 9:00 PM ET');
addEvent('wed',2100,2400,'Off The Air');
addEvent('thu',000,2100,'Off The Air');
addEvent('thu',2100,2300,'<a href="http://www.txrn.net:8000:listen.pls"><img src="http://www.tornradio.com/theshowonair.jpg"><br>The Show<br> 9:00 - 11:00 PM ET</a>');
addEvent('thu',2300,2400,'Off The Air');
addEvent('fri',000,2000,'Off The Air');
addEvent('fri',2000,2200,'Off The Air');
addEvent('fri',2200,2400,'Off The Air');
addEvent('sat',000,2400,'Off The Air');
addEvent('sun',000,1500,'Off The Air');
addEvent('sun',1500,2000,'Off The Air');
addEvent('sun',2000,2200,'<a href="playlist/qball.htm"><img src="http://www.tornradio.com/qballsmall.jpg"><br>Tha Mix On Tha Avenue<br>8:00 - 10:00 PM ET</a>');
addEvent('sun',2100,2400,'Off The Air');
setImage();
// -->
</script>
<!--webbot bot="HTMLMarkup" endspan -->
-------------------------------------------------------------------------
save as filename.js