文件对话框不显示

发布于 2024-11-03 07:57:44 字数 1585 浏览 0 评论 0原文

过去几天我一直面临这个问题。我在工具提示中有一个“文件”类型的输入。当我单击按钮打开文件对话框时,没有任何显示。现在我尝试使用 Valums AJAX Upload 并发生了同样的事情。问题是没有任何错误,所以我不知道如何调试以找出问题所在......这是我的代码:

<div class="liImageThumb tooltip-trigger">
    <div class="tooltip down">
        <div class="tooltip-arrow"></div>
            <p class="liUploadButton greenButton">Upload</p>
            <p class="okButton"></p>           
    </div>
</div>

<script type="text/javascript" src="@Url.Content("~/Scripts/fileuploader.js")"></script>
<script type="text/javascript">
    $(function () {
        var greenButton = $('.liUploadButton')[0];
        var uploader = new qq.FileUploader({
            element: greenButton,
            action: '@Url.Action("Upload", "Item")' //outputs the correct DOM node
        });
        console.log(greenButton);
    });

这是构建工具提示的代码:

$('.tooltip-trigger').removeClass('nonjs').live('mouseover', function(){
        var $trigger = $(this);
        var $tooltip = $('.tooltip',$trigger);
        if (!$trigger.data('init')){
            $trigger.data('init', true);
            if($tooltip.length){
                $trigger.hoverIntent({
                    'over':function(){$tooltip.show();},
                    'out':function(){$tooltip.hide();},
                    'timeout':200
                });
                $trigger.trigger('mouseover');
            }
        }
    });

您认为是什么阻止了对话框的显示?

I've been facing this problem for the past couple of days. I have an input of type "file" inside a tooltip. When I click on the button to open the file dialog, nothing shows up. Now I tried to use Valums AJAX Upload and the same thing happens. The problem is there aren't any errors so I do not know how I can debug to find out what the problem is... Here's my code:

<div class="liImageThumb tooltip-trigger">
    <div class="tooltip down">
        <div class="tooltip-arrow"></div>
            <p class="liUploadButton greenButton">Upload</p>
            <p class="okButton"></p>           
    </div>
</div>

<script type="text/javascript" src="@Url.Content("~/Scripts/fileuploader.js")"></script>
<script type="text/javascript">
    $(function () {
        var greenButton = $('.liUploadButton')[0];
        var uploader = new qq.FileUploader({
            element: greenButton,
            action: '@Url.Action("Upload", "Item")' //outputs the correct DOM node
        });
        console.log(greenButton);
    });

And here's the code that builds up the tooltip:

$('.tooltip-trigger').removeClass('nonjs').live('mouseover', function(){
        var $trigger = $(this);
        var $tooltip = $('.tooltip',$trigger);
        if (!$trigger.data('init')){
            $trigger.data('init', true);
            if($tooltip.length){
                $trigger.hoverIntent({
                    'over':function(){$tooltip.show();},
                    'out':function(){$tooltip.hide();},
                    'timeout':200
                });
                $trigger.trigger('mouseover');
            }
        }
    });

What do you think is preventing the dialog box from showing up?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夏了南城 2024-11-10 07:57:44

你在 ASP.Net MVC 项目中使用这个吗?根据 Url.Content 语法,我假设您是。
如果是,您的脚本标签 src 属性应类似于

src='<%=Url.Content("~/Content/script/MyFile.js")%>'

参考 答案了解详细信息。

Are you using this in ASP.Net MVC project ? I assume, you are, based on the Url.Content syntax.
If yes, your script tags src attribute should look like

src='<%=Url.Content("~/Content/script/MyFile.js")%>'

Refer this answer for details.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文