ASP.NET에서 다음과 같은 코드를 사용하여 사용자가 로그인 페이지로 이동할 때마다 임의의 이미지를 호출합니다. Internet Explorer에서 잘 작동하지만 다른 브라우저에서는 작동하지 않습니다. 내가 누락 된 것? 내 문제가 해결되지 않으면이 코드를 사용하여로그인 폼을 방문 할 때마다 ASP.NET에서 임의의 이미지가 표시됩니다.
<head runat="server">
<title>Login</title>
<link href="css/reset.css" rel="stylesheet" />
<link href="css/default.css" rel="stylesheet" />
<link href='http://fonts.googleapis.com/css?family=Carrois+Gothic' rel='stylesheet' type='text/css'/>
<script src="js/jquery-1.9.1.js"></script>
<script src="js/jquery-ui-1.10.3.custom.min.js"></script>
<script src="development-bundle/ui/jquery.ui.button.js"></script>
<script type="text/javascript">
$(function() {
$('input:submit, input:reset').each(function() {
$(this).replaceWith('<button type="submit" name="' + $(this).attr('name') + '" class="' + $(this).attr('class') + '" id="' + $(this).attr('id') + '" >' + $(this).val() + '</button>');
});
$("input:button, a, button", ".page").button();
$("a", ".demo").click(function() { return false; });
var images = ['image1.jpg', 'image2.jpg', 'image3.jpg', 'image4.jpg', 'image5.jpg', 'image6.jpg', 'image7.jpg', 'image8.jpg'];
$('body').css({ 'background': 'url(img/loginBackground/' + images[Math.floor(Math.random() * images.length)] + ') no-repeat fixed 100% 100%;' });
});
</script>
. 그것은 나를 Internet Explorer 또는 기타의 배경을 볼 수 없습니다 :
$("body").css({ 'background-image': 'url(img/loginBackground/' + images[Math.floor(Math.random() * images.length)] + ')'});
$("body").css({'background-repeat':'no repeat'});
$("body").css({'background-size':'100% 100%'});
가 어떻게이 jQuery를 디버깅 할 :
이 시도? 나는 중단 점을 놓았다. 그러나 그것은 멈추지 않았다. –
가장 좋은 방법은 $ (document) .ready (function() {}) –
의 코드를 $ (document) .ready (function() {})을 사용하여 실행하려고 시도했지만 여전히 사용할 수 없습니다. 작동하게 만들다. –