嗨 我的javascript和jquery的知識是非常基本的,所以我已經知道是什麼原因導致問題了。jquery ie7問題
我已經創建了一個簡單滑塊上顯示兩個消息,以便一個顯示器和幻燈片顯示第二之一,但它不是在IE7工作,我試圖在IE8,鉻,火狐代碼和歌劇和它的工作原理。
這裏是我的代碼:
HTML:
<head>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.cycle.js"></script>
<script type="text/javascript" src="js/slideshow.js"></script>
</head>
<body>
<div id="slideshow">
<div class="slides">
<ul>
<li id="slide-one">
<h3>slider 1</h3>
<p>content goes here
<br/><a href="#">Read More</a></p>
</li>
<li id="slide-two">
<h3>slider 2</h3>
<p>content goes here
<br/><a href="#">click here</a></p>
</li>
</ul>
</div>
<a href="# "id="designer"></a>
</div>
</body>
</html>
CSS:
#slideshow {
display: block;
margin: 0px auto 0px auto;
width: 520px;
height: 100px;
background-color: black;
color: black;
padding: 5px 5px 5px 5px;
font-family: Helvetica;
clear: both;
}
#slideshow h3 {
color: #aa102c;
}
.slides {
height: 100px;
width: 520px;
overflow: hidden;
background-color: white;
float: right;
}
#slide-one {
width: 515px;
height: 100px;
margin-left: 5px;
}
#slide-two {
width: 515px;
height: 100px;
margin-left: 5px;
}
#slideshow .slides h3 {
margin-top: 0;}
JS:
$slideshow = {
context: false,
tabs: false,
timeout: 5000,
slideSpeed: 2000,
tabSpeed: 300,
fx: 'scrollLeft',
init: function() {
this.context = $('#slideshow');
this.tabs = $('ul.slides-nav li', this.context);
this.prepareSlideshow();
},
prepareSlideshow: function() {
$('div.slides > ul', $slideshow.context).cycle({
fx: $slideshow.fx,
timeout: $slideshow.timeout,
speed: $slideshow.slideSpeed,
fastOnEvent: $slideshow.tabSpeed,
pager: $('ul.slides-nav', $slideshow.context),
pagerAnchorBuilder: $slideshow.prepareTabs,
before: $slideshow.activateTab,
pauseOnPagerHover: true,
pause: true
});
},
activateTab: function(currentSlide, nextSlide) {
var activeTab = $('a[href="#' + nextSlide.id + '"]', $slideshow.context);
}
};
$(function() {
$('body').addClass('js');
$slideshow.init();
});
JavaScript錯誤,如果有的話,被賦予了什麼? – Matt 2011-05-24 17:06:18
即時通訊沒有得到一個錯誤代碼 – DumboMorton 2011-05-24 17:15:26
已經擺弄了CSS已經計算出ie7不加載JavaScript和只顯示第二張幻燈片隱藏在第一個外面的大小,我已經設置div標記 – DumboMorton 2011-05-24 17:24:54