ie bugging out. any ideas?
hi I'm working on some jquery
http://www.paulbunker.plus.com/fadPanslides2.html It works like a dream in ff and chrome but ie is a pain I have no idea why. any ideas?
Thanks for taking the time to have a look :)
-Paul
- <style type="text/css">
- .link {
- color:red;
- font-size: 24px;
- text-transform: uppercase;
- text-decoration: none;
- word-spacing: 20px;
- }
- .link:hover {
- color:#000;
- }
- .content {
- position: absolute;
- visibility: hidden;
- top: 40px;
- background: #099;
- height: 300px;
- width: 300px;
- border: 2px solid #003;
- overflow: hidden;
- }
- #subLinks {
- position: absolute;
- top: 350px;
- }
- #slideViewer {
- overflow:hidden;
- position:relative;
- float:left;
- width:300px;
- height:300px;
- }
- #slideContainer {
- float: left;
- height: 300px;
- width: 9999999px;
- position: absolute;
- }
- .slides {
- float: left;
- height: 300px;
- width: 300px;
- }
- .hidden {
- visibility: hidden;
- }
- .visible {
- visibility: visible;
- }
- </style>
- <script type="text/javascript">
-
- $(document).ready(function(){
-
-
- // Main Navigation
- $('.link').click(function(){
-
- current = '#'+$('.visible').attr('id');
- next = '#'+$(this).attr('id')+'Div';
- $(current).animate({opacity:0},500,'swing', function(){
- $(current).removeClass('visible');
- $(current).animate({opacity:1},0,'swing');
- });
- if (current != next ){
- $(next).animate({opacity:0},200,'swing', function(){
- $(next).addClass('visible');
- $(next).animate({opacity:1},500,'swing');
- })};
-
- if (next == '#oneDiv' ){
- $('#subLinks').removeClass('hidden').addClass('visible');
- }
- if (next == current) {
- $('#subLinks').removeClass('visible').addClass('hidden');
- }
- if (next != '#oneDiv' ){
- $('#subLinks').removeClass('visible').addClass('hidden');
- }
-
- }); // End Main Navigation
- //Slides
- $('#slideContainer div:first').addClass('currentSlide');
- $('.slide').click(function(){
- var evt = $(this).attr('id'); // back or next
- var current = $('.currentSlide');
- var next = current.next();
- var prev = current.prev();
-
- if ($(current).prev().length == 0){
- prev = $('#slideContainer div:last');
- }
- if ((next).length == 0){
- next = $('#slideContainer div:first');
- }
-
- var currentLeft = ((current).position().left);
- var previousLeft = ((prev).position().left);
- var nextLeft = ((next).position().left);
-
- if (evt == 'next'){
- (current).removeClass('currentSlide');
- (next).addClass('currentSlide');
- var translateLeft = -nextLeft;
- $('#slideContainer').animate({'left':translateLeft}, 500);
- }
- if (evt == 'back'){
- (current).removeClass('currentSlide');
- (prev).addClass('currentSlide');
- var translateLeft = -previousLeft;
- $('#slideContainer').animate({'left':translateLeft}, 500);
- }
-
- });
-
- }); // End Document Ready
- </script>
- </head>
- <body>
- <a href="#" class="link" id="one">one</a> <a href="#" class="link" id="two">two</a> <a href="#" class="link" id="three">three</a>
- <div class="content" id="oneDiv">
- <div id="slideViewer">
- <div id="slideContainer">
- <div class="slides">Slide 1</div>
- <div class="slides">Slide 2</div>
- <div class="slides">Slide 3</div>
- </div>
- </div>
- </div>
- <div class="content" id="twoDiv">Content for id "two" Goes Here</div>
- <div class="content" id="threeDiv">Content for id "three" Goes Here</div>
- <div id="subLinks" class="hidden"><a href="#" id="back" class="slide">Back</a> - <a href="#" id="next" class="slide">Next</a></div>
- </body>