我有phonegap应用程序可以在Windows Phone 7下运行,但我有2个问题。
车轮没有旋转。
当我点击任何按钮时,会出现一个灰色方块 此
你可以帮我解决这个问题吗?
这是代码:
<head>
<style type="text/css">
.BBImagesStyle
{
height: 85px;
width: 85px;
}
</style>
</head>
<div id="WheelDiv" style="display: block; width: 100%; height: 100%; background-color: transparent; padding: 0; margin: 0;">
<script language="javascript" type="text/javascript">
$(document).ready(function () {
var ua = navigator.userAgent; //Grab USER AGENT STRING
var checker = { webOS: ua.match(/webOS/), iphone: ua.match(/iPhone/), ipad: ua.match(/iPad/), ipod: ua.match(/iPod/), blackberry: ua.match(/BlackBerry/), android: ua.match(/Android/), symbian: ua.match(/Symbian/) };
if (checker.blackberry) {
setTimeout(' BB();', 500);
} else {
var HalfscreenHeight = $(window).height();
$("#WheelContentDiv").height(HalfscreenHeight);
if ($(window).height() <= 620) {
$("#WheelContentDiv").CloudCarousel(
{
xPos: 165,
yPos: 75,
yRadius: 100,
bringToFront: false,
minScale: 0.5,
clickActionOnLowerIconOnly: false
});
var HalfscreenHeightQua = "";
if ($(window).height() < 600) {
HalfscreenHeightQua = $(window).height() * 0.05;
} else {
HalfscreenHeightQua = $(window).height() * 0.15;
}
$("#WheelContentDiv").css("padding-top", HalfscreenHeightQua + "px");
$("#Taw3DLogo").css("padding-top", "100px");
document.getElementById("Wheel_MedicalServices").src = "../TawuniyaMobileWeb/Images/Wheel/Wheel_MedicalServices.png";
document.getElementById("Wheel_Tracking").src = "../TawuniyaMobileWeb/Images/Wheel/Wheel_Tracking.png";
document.getElementById("Wheel_ContactUS").src = "../TawuniyaMobileWeb/Images/Wheel/Wheel_ContactUs.png";
document.getElementById("Wheel_Products").src = "../TawuniyaMobileWeb/Images/Wheel/Wheel_Products.png";
document.getElementById("Wheel_Offers").src = "../TawuniyaMobileWeb/Images/Wheel/Wheel_Offers.png";
document.getElementById("Wheel_Locations").src = "../TawuniyaMobileWeb/Images/Wheel/Wheel_Locations.png";
} else {
var h = $(window).height() / 5;
var w = $(window).width() / 2.5;
$("#middleLogoImg").css("width", w / 2 + "px");
$("#Taw3DLogo").css("padding-left", w / 3.2 + "px");
$("#WheelContentDiv").CloudCarousel(
{
xPos: 165,
yPos: 65,
yRadius: h,
xRadius: w,
bringToFront: false,
minScale: 0.5,
clickActionOnLowerIconOnly: false
});
var HalfscreenHeight_ = $(window).height() * 0.2;
$("#WheelContentDiv").css("padding-top", HalfscreenHeight_ + "px");
document.getElementById("Wheel_MedicalServices").src = "Images/Wheel/Wheel_MedicalServices@2.png";
document.getElementById("Wheel_Tracking").src = "Images/Wheel/Wheel_Tracking@2.png";
document.getElementById("Wheel_ContactUS").src = "Images/Wheel/Wheel_ContactUs@2.png";
document.getElementById("Wheel_Products").src = "Images/Wheel/Wheel_Products@2.png";
document.getElementById("Wheel_Offers").src = "Images/Wheel/Wheel_Offers@2.png";
document.getElementById("Wheel_Locations").src = "Images/Wheel/Wheel_Locations@2.png";
$("#Taw3DLogo").css("padding-top", "180px");
$("#Wheel_Tawuniya").css("overflow", "hidden");
$("#WheelContentDiv").css("overflow", "");
}
DisableWindowScroll();
$("#ALLPageContent").css("background-image", "url(../TawuniyaMobileWeb/Images/HomeScreenBackground.png)");
var leftno = Math.max(0, (($(window).width() - $("#WheelContentDiv").outerWidth()) / 2) + $(window).scrollLeft()) - 20 + "px";
$("#WheelContentDiv").css("left", leftno);
// alert(450);
}
try {
var isWindowsPhone = /windows phone/i.test(navigator.userAgent.toLowerCase());
if (isWindowsPhone) {
window.external.notify("noScroll");
setTimeout('WP2();', 1500);
}
} catch (e) { alert(e); }
ModifyHeaderOnBlur(false);
try {
if (navigator.geolocation) {
//navigator.geolocation.getCurrentPosition(LocationsSuccess, LocationError);
} else {
alert('geolocation not supported');
}
} catch (e) {
}
});
</script>
<div id="WheelContentDiv" style="width: 330px; background-color: transparent; position: fixed;">
<div id="Taw3DLogo" style="z-index: 1000000; padding-left: 110px;">
<img id="middleLogoImg" src="../ePortal5Core/Libs/jQuery/Ext/professorcloud_carousel/Taw3DLogo.png"
width="110" style="visibility: hidden;" />
</div>
<center>
<img style="visibility: hidden;" id="Wheel_MedicalServices" class="cloudcarousel"
alt="" onclick="MoveToPortalCustomize('Login_Tawuniya', this);OpenMedicalServiceWidgets='True';DisableWindowScroll();Check_remember();">
<img style="visibility: hidden;" id="Wheel_Tracking" class="cloudcarousel" alt=""
onclick="MoveToPortalCustomize('Tracking_PreLogin', this);">
<img style="visibility: hidden;" id="Wheel_ContactUS" class="cloudcarousel" alt=""
onclick="MoveToPortalCustomize('ContactUS_PreLogin', this);">
<img style="visibility: hidden;" id="Wheel_Products" class="cloudcarousel" alt=""
onclick="MoveToPortalCustomize('Products', this);">
<img style="visibility: hidden;" id="Wheel_Offers" class="cloudcarousel" alt="" onclick="MoveToPortalCustomize('Promotions', this);">
<img style="visibility: hidden;" id="Wheel_Locations" class="cloudcarousel" alt=""
onclick="MoveToPortalCustomize('Locations', this);">
</center>
</div>
<div id="WheelContentDivBB" style="width: 100%; background-color: transparent; height: 100%;
display: none;">
<center>
<table id="BBWheelTable" style="z-index: 1000000; width: 100%; height: 100%; margin-left: 0px;">
<tr>
<td>
<img id="Wheel_MedicalServicesBB" class="BBImagesStyle" src="../TawuniyaMobileWeb/Images/Wheel_MedicalServices.png"
alt="" onclick="MoveToPortalCustomize('Login_Tawuniya', this);OpenMedicalServiceWidgets='True';DisableWindowScroll();Check_remember();">
</td>
<td>
<img id="Wheel_TrackingBB" class="BBImagesStyle" src="../TawuniyaMobileWeb/Images/Wheel_Tracking.png"
alt="" onclick="MoveToPortalCustomize('Tracking_PreLogin', this);">
</td>
<td>
<img id="Wheel_ContactUSBB" class="BBImagesStyle" src="../TawuniyaMobileWeb/Images/Wheel_ContactUs.png"
alt="" onclick="MoveToPortalCustomize('ContactUS_PreLogin', this);">
</td>
</tr>
<tr>
<td>
<img id="Wheel_ProductsBB" class="BBImagesStyle" src="../TawuniyaMobileWeb/Images/Wheel_Products.png"
alt="" onclick="MoveToPortalCustomize('Products', this);">
</td>
<td>
<img id="Wheel_OffersBB" class="BBImagesStyle" src="../TawuniyaMobileWeb/Images/Wheel_Offers.png"
alt="" onclick="MoveToPortalCustomize('Promotions', this);">
</td>
<td>
<img id="Wheel_LocationsBB" class="BBImagesStyle" src="../TawuniyaMobileWeb/Images/Wheel_Locations.png"
alt="" onclick="MoveToPortalCustomize('Locations', this);">
</td>
</tr>
</table>
</center>
</div>
答案 0 :(得分:1)
#1
我不确定旋转木马的实现,但如果它基于mousemove(WP7浏览器不支持开箱即用),请确保使用最新的Cordova for WP 7.5版本,为mousemove事件添加了一些特殊的polyfill 。您还可以将以下代码添加到index.html头文件,以确保没有js错误
<script type="text/javascript">
window.console = {
log: function (str) { window.external.Notify(str); }
};
// output errors to console log
window.onerror = function (e) {
console.log("window.onerror ::" + JSON.stringify(e));
};
console.log("Installed console !");
</script>
#2
Windows Phone 7 Browser - Turn off the gray shading when links are clicked