【发布时间】:2011-01-17 12:08:46
【问题描述】:
我的网站似乎可以在大多数浏览器中运行,但在 Mac 系列(iPhone 等)中。
大多数功能都可以使用,但是当涉及使用图像作为目标的选择部分时,选择不起作用。
我没有要测试的 iPhone,但根据反馈 - 在页面(链接到下面)上,初始图标单击会打开带有图标的模态窗口以供选择 - 这是该选择不起作用。
此图标选择的代码示例如下:
jQuery(function() {
jQuery('#cd').click(function() {
jQuery('#cd').fadeTo('fast',1);
jQuery('#dvd').fadeTo('fast', .25, function() {
jQuery('input[name=frmmedia]').val(1);
jQuery('#next').show();
});
});
});
jQuery(function() {
jQuery('#dvd').click(function() {
jQuery('#dvd').fadeTo('fast',1);
jQuery('#cd').fadeTo('fast', .25, function() {
jQuery('input[name=frmmedia]').val(2);
jQuery('#next').show();
});
});
});
本例中包含图标的php代码/页面是:
<div id="selmodule">
<div id="optionholder"><img src="../img/pricemodules/dvd.jpg" alt="dvd" name="dvd" width="199" height="85" class="hoverswap" id="dvd" /><img src="../img/pricemodules/cd.jpg" alt="compact disc" name="cd" width="212" height="85" class="hoverswap" id="cd" />
</div>
</div>
<br />
<br />
<h3>Changing this option <br/>will reset the packaging options</h3>
<form action="sess-set-reset.php" method="get" id="firstform" >
<input name="frmmedia" type="hidden" id="frmmedia" value="" />
<div id="next"><input type="image" name="Submit" value="Next" src="../img/page-elements/confirm.jpg"/>
</div>
</form>
打开上述 PHP 页面的代码是这个(在 iPhone 上可以工作)
//----media elements-----------------------------------------------------
jQuery(function (jQuery) {
jQuery('.media').click(function (e) {
e.preventDefault();
jQuery('#contentholder').load("media.php");
jQuery("#contentholder").modal({
onOpen: function (dialog) {
dialog.overlay.fadeIn('fast', function () {
dialog.data.hide();
dialog.container.fadeIn('fast', function () {
dialog.data.slideDown('fast');
});
});
}
});
})
})
实际页面是此处的“定价”页面: discburner 任何建议将不胜感激。谢谢
【问题讨论】:
-
在 Apple 开发工具的模拟器中,它似乎在 iPhone 4 (iOS v4.0) 和 iPad (iOS v3.2) 上运行良好。也许你现在已经修好了?还是我尝试错了?
标签: php jquery iphone ipad safari