내 페이지에 JavaScript 슬라이드 아웃 메뉴가 있습니다. 페이지가로드 될 때 메뉴가 잘못된 위치에 표시되고 열릴 때 표시됩니다 (기본값으로 닫아야 함). 그런 다음 페이지가로드되면 올바른 위치와 상태로 점프합니다.로딩 중 Div 위치가 잘못됨
메뉴를 마지막으로로드하거나 올바른 위치에 놓기를 원합니다. 나는 숨겨진 메뉴의 스타일을 만들려고 시도했다. 자바 스크립트로 페이지로드시 블록으로 표시하지만 메뉴는 숨겨져있다.
<link rel="stylesheet" type="text/css" media="all" href="<css/style.css" />
<link rel="stylesheet" type="text/css" media="all" href="</css/reset.css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.tabSlideOut.v1.3.js"></script>
<script type="text/javascript" src="js/jquery.cycle.all.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.slide-out-div').tabSlideOut({
tabHandle: '.handle',
pathToTabImage: 'images/closed_menu.png', //class of the element that will become your tab
imageHeight: '230px', //height of tab image //Optionally can be set using css
imageWidth: '62px', //width of tab image //Optionally can be set using css
tabLocation: 'left', //side of screen where tab lives, top, right, bottom, or left
speed: 600, //speed of animation
action: 'hover', //options: 'click' or 'hover', action to trigger animation
topPos: '270px', //position from the top/ use if tabLocation is left or right
leftPos: '30px', //position from left/ use if tabLocation is bottom or top
fixedPosition: false //options: true makes it stick(fixed position) on scroll
});
$("div.slide-out-div").mouseover(function(){
$('.handle').css("background-image", "url(images/open_menu.png)");
}).mouseout(function(){
$('.handle').css("background-image", "url(images/closed_menu.png)");
});
$('#sliderimages').cycle({
fx: 'fade',
speed: 'fast',
timeout: 0,
next: '#next',
prev: '#prev'
});
});
</script>
<body onload="javascript:document.getElementByClass('slide-out-div').style.display = 'block';">
다음 CSS
.slide-out-div {
display: none;
padding-left: 0px;
width: 200px;
z-index: 3;
position: relative;
}
이
변경, 또는 내용 후인가? – Eric
_ "숨겨진 메뉴의 스타일을 만들려고했는데 JavaScript로 페이지를로드 할 때 표시되지만 메뉴는 숨겨져 있습니다."_ - 일부 코드를 볼 수 있습니까? – Eric
당신의 목적에 맞는 해결책 (결함에 의해 숨겨 지거나 닫히게하고 JS를 통해 후자를 여는 것)은 나에게 좋을 것 같다. 우리는 마술처럼 오타 또는 다른 실수로 작업하지 못하게했는지 파악할 수 없습니다 :) 문제점을 보여주기 위해 최소한의 기능적 예제를 만들 수 있습니까? – hugomg