jQuery Mobile-手风琴中的链接和单选按钮不起作用 [英] jQuery Mobile - Links and Radio buttons in Accordion not working

查看:53
本文介绍了jQuery Mobile-手风琴中的链接和单选按钮不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站此处.

到达那里后,点击学生说明,然后点击帮助按钮.当它尝试转到该文档(服务器上的PDF)时,页面出现未定义...但是该文档的URL是正确的.当我刷新页面时,它将带我到文档.

When you get there, click on Student Instructions and then hit the Help button. When it tries to go to that document (a PDF on the server), the page comes up undefined... but the URL to the document is correct. When I refresh the page, then it takes me to the document.

为什么要这么做?

这是页面该部分的摘录...

    <div data-role="collapsible-set" data-theme="c" data-content-theme="d">

        <div data-role="collapsible">
            <h3><img src="images/gear.png" style="vertical-align: middle; ">Student Instructions...</h3>
                    <ul>
                        <li>+ Create a GoArmyEd Account. <a href="docs/TA- GoArmyEd-LOI-Walkthrough-SUO-2-15-13.pdf"><span style="font-size:12px; font-family:Verdana, Geneva, sans-serif;">Need a walkthrough?</span><img src="images/walkthrough.png" style="vertical-align: middle;"></a></li><br>
                        <li>+ Print Statement of Understanding (South University) and have it signed by their Commander.</li><br>
                        <li>+ Receive Cost Verification worksheet (CVWS) and Degree Progress Audit (DPA).</li><br>
                        <li>+ Upload all documents into GoArmyEd.</li><br>
                        <li>+ Apply for Tuition Assistance.</li>

                    </ul>
        </div>

,您会注意到当您返回原始页面时,有几个单选按钮显示为被单击.我使用jQuery单选按钮布局是因为我喜欢它...我只是不知道如何使那些按钮单击消失.看起来糟透了.

Also, you'll notice that when you back to the original page, there are several radio buttons that appear clicked. I used the jQuery radio button layout because I like it... I just don't know how to make those button clicks go away. It looks terrible.

有什么想法吗?

更新-我尝试分别添加rel="external"data-ajax="false".右键单击并单击在新选项卡中打开链接",我可以打开文档.

Update - I tried adding rel="external", data-ajax="false" separately and together. I'm able to open the document when I right-click and "Open link in a new tab"... Still doesn't open onclick though.

更新2 -尝试添加以下内容,但禁用了我的整个样式表.

Update 2 - Tried adding the following, but it disabled my entire style sheet.

<script>
    $(document).bind("mobileinit", function(){
    $.mobile.ajaxLinksEnabled(false);
    }); 
</script>

推荐答案

这个简单的Google embed文档.

This simple with google embed document.

1)照常创建指向该页面的链接" 2)在目标页面上添加此iframe

1) create your link to that page as usual' 2) on the destination page add this iframe

<iframe src="http://docs.google.com/viewer?url=http://yoursite.com/folderWhereYouHideYourPdfFile/yourPdfFile.pdf&embedded=true" width="100%" height="100%" frameborder="0">

这将嵌入文档. 您可以然后对其进行样式设置. 如果需要,可以使用ajax弹出或加载.

this will embed the document. you can then style it up. if you want, can be to popup or load with ajax.

============================另一种方法可能是使用Php ============= === 因此,除了目标网页上的iframe,您还可以使用类似的

=============================Another Method Could be to use Php============== So Instead of iframe on destination page you can have something like this

<?php
$filePdf = 'yourPdfFile.pdf';
$fileTitle = 'Become A Solider'; 

header('Content-type: application/pdf');
header('Content-Disposition: inline; filename="' . $fileTitle . '"');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($filePdf));
header('Accept-Ranges: bytes');

@readfile($filePdf);
?>

这篇关于jQuery Mobile-手风琴中的链接和单选按钮不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆