gpt4 book ai didi

jquery - 奇怪的 jQuery 问题

转载 作者:行者123 更新时间:2023-12-01 08:29:06 25 4
gpt4 key购买 nike

下面的 jQuery 获取包含 html 地址表的部分 View 。然后使用 jqModal 显示地址,并使用鼠标悬停来突出显示地址。这在我的本地机器上运行良好。当我尝试从服务器(Win 2008、IIS 7)运行它时,地址显示在 jqModal 中,但突出显示无法工作。此外,从服务器浏览时效果很好。

<script>
$(document).ready(function() {

$("#Search").click(function() {
displayAddressList();
});
$('#dialog').jqm();

});


function displayAddressList() {
var PostCode = $("#tbSearch").val();
var url = '<%= Url.Action("AddressSearch", "Addresses")%>';
$.get(url, { PostCode: PostCode }, function(data) {
$("#dialog").html(data);

$('table#data_table tr').mouseover(function() {
$(this).addClass('selectedRow');
}).mouseout(function() {
$(this).removeClass('selectedRow');
});

});
}
</script>

<style>
.selectedRow {
background-color: white;
cursor: pointer;
}
</style>

<div class="jqmWindow" id="dialog">
<a href="#" class="jqmClose">Close</a>
</div>

最佳答案

如果您不关心 Internet Explorer 6 支持,则可以在 CSS 中实现行突出显示。

#data_table tr:hover {
background-color: white;
cursor: pointer;
}

如果您这样做,请确保 HTML 页面顶部有有效的 DOCTYPE 声明。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

关于jquery - 奇怪的 jQuery 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1005884/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com