文件对话框不显示
过去几天我一直面临这个问题。我在工具提示中有一个“文件”类型的输入。当我单击按钮打开文件对话框时,没有任何显示。现在我尝试使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你在 ASP.Net MVC 项目中使用这个吗?根据
Url.Content
语法,我假设您是。如果是,您的脚本标签
src
属性应类似于参考 此答案了解详细信息。
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 likeRefer this answer for details.