Web Design Forum: Jquery slider problem (IE) - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Jquery slider problem (IE)

#1 User is offline   TexasWreckShop 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 31-January 12
  • Reputation: 0

Posted 31 January 2012 - 11:15 PM

Hi everyone, this is my first post so a little about myself.
I'm a 23 year old Web Designer studying at Arizona State University and I live in Tucson, AZ currently working for an international spa & pool company as their web admin and print designer.

I have a website I am working on where I have implemented a Jquery slider with 5 images at 900px each
in action here the thing displays fine in Firefox (big surprise there) but in I.E the last image in the group is being pushed under the rest and thus not displaying. Also, the images are not sliding into place and the previous jpg is visible when I slide over, any help would be greatly appreciated.
Below is the relevant html & css


 <div id="top">
    <div class="window">
    <div class="image_reel">
      <a href="#"><img src="images/slide1.jpg" alt="" width="900" height="300"></a>
      <a href="#"><img src="images/slide2.jpg" alt="" width="900" height="300"></a>
      <a href="#"><img src="images/slide3.jpg" alt="" width="900" height="300"></a>
      <a href="#"><img src="images/slide4.jpg" alt="" width="900" height="300"></a>
      <a href="#"><img src="images/slide5.jpg" alt="" width="900" height="300"></a>
     
      </div>
    </div>
    <div class="paging">
      <a href="#" rel="1"></a>
      <a href="#" rel="2"></a>
      <a href="#" rel="3"></a>
      <a href="#" rel="4"></a>
      <a href="#" rel="5"></a>
      
      
      
      </script>
      <script> $(document).ready(function() {

	//Set Default State of each portfolio piece
	$(".paging").show();
	$(".paging a:first").addClass("active");
		
	//Get size of images, how many there are, then determin the size of the image reel.
	var imageWidth = $(".window").width();
	var imageSum = $(".image_reel img").size();
	var imageReelWidth = imageWidth * imageSum;
	
	//Adjust the image reel to its new size
	$(".image_reel").css({'width' : imageReelWidth});
	
	//Paging + Slider Function
	rotate = function(){	
		var triggerID = $active.attr("rel") - 1; //Get number of times to slide
		var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide

		$(".paging a").removeClass('active'); //Remove all active class
		$active.addClass('active'); //Add active class (the $active is declared in the rotateSwitch function)
		
		//Slider Animation
		$(".image_reel").animate({ 
			left: -image_reelPosition
		}, 1200 );
		
	}; 
	
	//Rotation + Timing Event
	rotateSwitch = function(){		
		play = setInterval(function(){ //Set timer - this will repeat itself every 3 seconds
			$active = $('.paging a.active').next();
			if ( $active.length === 0) { //If paging reaches the end...
				$active = $('.paging a:first'); //go back to first
			}
			rotate(); //Trigger the paging and slider function
		}, 7000); //Timer speed in milliseconds (3 seconds)
	};
	
	rotateSwitch(); //Run function on launch
	
	//On Hover
	$(".image_reel a").hover(function() {
		clearInterval(play); //Stop the rotation
	}, function() {
		rotateSwitch(); //Resume rotation
	});	
	
	//On Click
	$(".paging a").click(function() {	
		$active = $(this); //Activate the clicked paging
		//Reset Timer
		clearInterval(play); //Stop the rotation
		rotate(); //Trigger rotation immediately
		rotateSwitch(); // Resume rotation
		return false; //Prevent browser jump to link anchor
	});	
	
});
</script>
    </div>
    
  </div>


.window {
	height:300px;
	width: 900px;
	overflow: hidden; /*--Hides anything outside of the set width/height--*/
	position: relative;
}
.image_reel {
	position: absolute;
	top: 0;
	left: 0;
	width: 900px;
}
.image_reel img {
	float: left;
}

/*--Paging Styles--*/
.paging {
	position: relative;
	bottom: 0px;
	right: -690px;
	width: 250px;
	height:30px;
	z-index: 100; /*--Assures the paging stays on the top layer--*/
	text-align: center;
	line-height: 50px;
	display: none;
	background-repeat: no-repeat;
	top: -40px;
}
.paging a {
	padding: 12px;
	text-decoration: none;
	background-image: url(images/paging1bg.png);
	background-repeat: no-repeat;
	background-position: center;
}
.paging a.active {
	-khtml-border-radius: 3px;
	-webkit-border-radius: 3px;
	background-image: url(images/paging2bg.png);
	background-repeat: no-repeat;
}
.paging a:hover {
	font-weight: bold;
	background-image: url(images/paginghover.png);
}

0

#2 User is offline   .dark .negativ .antisocial 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 41
  • Joined: 02-July 11
  • Reputation: 5
  • Gender:Male
  • Location:Germany
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 01 February 2012 - 10:15 AM

Looks like the internet explorer pushes your pictures around 5px to much right.
So in the end the last pictures do not fits into the container.

Try something with a stylesheet only for IE
 <!--[if IE]>
    <style type="text/css">@import url(ie.css);</style>
  <![endif]-->


There your have to play with the margin (set to 0?) or with the position-properties.

I´m sorry this is not a big help :-D
But most of the times if you just play little bit around you will get a solution.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users