简体   繁体   English

jQuery单击事件问题iPhone,Safari iPad

[英]jQuery click event problem iPhone, Safari iPad

My site seems to function in most browsers but in the Mac series (iPhone etc). 我的网站似乎可以在大多数浏览器中运行,但可以在Mac系列(iPhone等)中运行。

Most of the features work but when it comes to a select section using images as the target the selection isn't working. 大多数功能都可以使用,但是当使用图像作为目标的选择区域时,选择不起作用。

I don't have an iPhone to test but according to feedback - on the page (linked to below) the initial icon click brings up the modal window with the icons to choose - it is that selection that doesn't work. 我没有要测试的iPhone,但根据反馈-在页面上(链接到下面),最初的图标单击会弹出模态窗口,其中包含可供选择的图标-就是这种选择无效。

An example of the code for this icon selection is: 该图标选择的代码示例为:

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();
 });
});
});

The php code/page that contains the icons in this example is: 在此示例中,包含图标的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>

The code that opens the above PHP page is this (which DOES work on iPhone) 打开上面的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');
                });
            });
        }
    });
})
})

The actual page is the 'pricing' page here: discburner Any suggestions would be greatly appreciated. 实际页面是此处的“定价”页面: discburner任何建议将不胜感激。 Thank you 谢谢

iOS does not have a browsable file system like a computer, so even if Safari supported file uploads, you would not be able to browse to the file to select it. iOS没有像计算机这样的可浏览文件系统,因此即使Safari支持上传文件,您也将无法浏览到文件来选择它。

This is for security reasons as every iOS app runs in a sandbox and has no access to other apps data. 出于安全原因,因为每个iOS应用程序都在沙箱中运行,并且无法访问其他应用程序数据。

You can download or write App so as to upload the Photos and Videos.. 您可以下载或编写App来上传照片和视频。

You can / should install a tool such as iPhoney for Mac, or iBBDemo2 for Windows.. or ideally, the Xcode /iPhone SDK if you're on a Mac - and test all your sites yourself in these emulated environments. 您可以/应该安装一个工具,例如Mac的iPhoney或Windows的iBBDemo2 。或者,如果您是Mac,则最好安装Xcode / iPhone SDK-并在这些模拟环境中亲自测试所有站点。 You can also find several online MobileSafari "simulators. Here , or Here , for example. Touch events can be dicey, and as of this writing, they are not all resolved in the standard jQuery libs. If you can't work through this issue, an interesting, up-and-coming solution can be found with the jQuery "Mobile" project , now in beta. 您还可以找到几个在线的MobileSafari“模拟器”。例如, hereHere 。触摸事件可能很简单,在撰写本文时,它们并未在标准jQuery库中全部解决。如果无法解决此问题, ,现在可以通过Beta版的jQuery“ Mobile”项目找到一个有趣的,崭露头角的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM