簡體   English   中英

jQuery Mobile-手風琴中的鏈接和單選按鈕不起作用

[英]jQuery Mobile - Links and Radio buttons in Accordion not working

在這里有一個網站。

當您到達那里時,單擊“ 學生說明” ,然后單擊“ 幫助”按鈕。 當它嘗試轉到該文檔(服務器上的PDF)時,頁面出現未定義...但該文檔的URL正確。 當我刷新頁面時,它將帶我到文檔。

為什么這樣做呢?

這是頁面那部分的片段...

    <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單選按鈕布局是因為我喜歡它...我只是不知道如何使那些按鈕單擊消失。 看起來糟透了。

有什么想法嗎?

更新 -我嘗試將rel="external"data-ajax="false"分別添加在一起。 右鍵單擊並單擊“在新選項卡中打開鏈接”時,我可以打開文檔。盡管如此,仍然無法打開onclick。

更新2-嘗試添加以下內容,但禁用了我的整個樣式表。

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

這個簡單的與谷歌embed文件。

1)照常創建指向該頁面的鏈接'2)在目標頁面上添加此iframe

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

這將嵌入文檔。 然后可以對其進行樣式設置。 如果需要,可以使用ajax彈出或加載。

============================另一種方法可能是使用Php ================因此,除了目標網頁上的iframe外,您還可以使用以下內容

<?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);
?>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM