[英]Adding an android smart app banner icon using Javascript
我使用下面的腳本在我的網站上顯示app smart banner。 一切都很好,但圖標沒有出現在chrome(Android)中。
我試圖添加圖標和不同大小的網址,但問題仍然存在。
<html>
<head>
<title>MyPage</title>
<meta name="apple-itunes-app" content="app-id=502838820">
<meta name="google-play-app" content="app-id=ru.hh.android">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/smart-app-banner.css" type="text/css" media="screen">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<link rel="android-touch-icon" href="android-icon.png" />
</head>
<body>
...
<script src="js/smart-app-banner.js"></script>
<script type="text/javascript">
new SmartBanner({
daysHidden: 15, // days to hide banner after close button is clicked (defaults to 15)
daysReminder: 90, // days to hide banner after "VIEW" button is clicked (defaults to 90)
appStoreLanguage: 'us', // language code for the App Store (defaults to user's browser language)
title: 'MyPage',
author: 'MyCompany LLC',
button: 'VIEW',
store: {
ios: 'On the App Store',
android: 'In Google Play',
windows: 'In Windows store'
},
price: {
ios: 'FREE',
android: 'FREE',
windows: 'FREE'
}
, icon: 'img/icon.png'
// , theme: '' // put platform type ('ios', 'android', etc.) here to force single theme on all device
// , icon: '' // full path to icon image if not using website icon image
// , force: 'ios' // Uncomment for platform emulation
});
</script>
</body>
</html>
老實說,只需使用<img>
標簽而不是<link>
並將href
設置為圖像數據。 你可以將你的Javascript變成一個類,並在你新制作的<img>
標簽中調用它,基本上我有相同的結果。
看看這些: 使用jQuery更改圖像源
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.