开发者

JQuery Thickbox - Can't get it to display

开发者 https://www.devze.com 2022-12-24 22:25 出处:网络
I am using JQuery for the first time today. I can\'t make it to work (It simple doesnt show up). I want to display inline content using Thickbox (Eventually I will be displaying a PDF in an iframe). I

I am using JQuery for the first time today. I can't make it to work (It simple doesnt show up). I want to display inline content using Thickbox (Eventually I will be displaying a PDF in an iframe). I have included all the javascript and css files etc. and referenced them as in code below.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="JQueryLearning._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>

    <script src="Scripts/thickbox.js" type="text/javascript"></script>

    <script src="Scripts/thickbox-compressed.js" type="text/javascript"></script>

    开发者_如何学JAVA<script src="Scripts/jquery-1.4.2.min.js" type="text/javascript"></script>

    <link href="App_Themes/Theme/Css/thickbox.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <a href="#TB_inline?height=50&width=300&inlineId=hiddenModalContent"
                title="Simple Demo" class="thickbox">Show hidden content.</a>
        <div id="hiddenModalContent" style="display: none;">
            <div style="text-align: center;">
                Hello ThickBox!</div>
        </div>
    </div>
    </form>
</body>
</html>

Am I missing something? Thanks, Ali


I think you need to alter the sequence of the script files, otherwise they won't work properly:

<script src="Scripts/jquery-1.4.2.min.js" type="text/javascript"></script>

<script src="Scripts/thickbox.js" type="text/javascript"></script>

<script src="Scripts/thickbox-compressed.js" type="text/javascript"></script>

<link href="App_Themes/Theme/Css/thickbox.css" rel="stylesheet" type="text/css" />

Also: Aren't "thickbox.js" and "thickbox-compressed.js" different compression formats of the same module? In that case, you can omit one of them. If you want to debug inside the js, you need "thickbox.js", otherwise "thickbox-compressed.js" is sufficient.

0

精彩评论

暂无评论...
验证码 换一张
取 消