jQuery에서 -=
을 처리하는 것이 css()
에서 IE8에서 작동하지 않는 것 같습니다. 다음 코드는 오류가 없지만 작동하지 않습니다. 나는 위에서 언급 한 연산자로 그것을 좁혔습니다.= jQuery의 css 메서드에서 연산자가 IE8에서 작동하지 않습니다.
var postCount = $(".postsWrapper .window .posts article").length;
var numberOfPages = Math.ceil(postCount/3);
var currentPage = 1;
var transitioning = false;
$(".postsWrapper button").click(function() {
var direction = $(this).attr("data-direction");
var postWindowWidth = $(".postsWrapper .window").width();
if (direction == "next" && currentPage < numberOfPages && transitioning == false) {
transitioning = true;
// the below line does nothing in IE8
$(".postsWrapper .window .posts").css("marginLeft", "-=" + postWindowWidth);
setTimeout(function() {
transitioning = false;
}, 1000);
currentPage++;
} else if (direction == "previous" && currentPage > 1 && transitioning == false) {
transitioning = true;
// the below line does nothing in IE8
$(".postsWrapper .window .posts").css("marginLeft", "+=" + postWindowWidth);
setTimeout(function() {
transitioning = false;
}, 1000);
currentPage--;
}
});
는 문제가 margin-left
속성 값 auto
함께 시작이다, 그래서 JQuery와/감소에게 그것을 증가 할 수 http://www.weblinxinc.com/beta/candy-controls/demo/site/index.htm
'무엇을 않습니다
여기에 라이브 예제에 대한 소스입니까? –
질문이 있습니까? – Soren
이것은 연산자가 아니며, 상대적인 CSS 값입니다 (이것은 전적으로 jQuery 일뿐입니다). –