JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 1st, 2012, 02:29 PM
SomethingAboutR SomethingAboutR is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 1 SomethingAboutR User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m 7 sec
Reputation Power: 0
Frustration with jquery image slider

I'm sure it is something dumb, but so irritating!!

I have this very simple page with an image slider on it. It works fine, first image fades in, slides to second image. Stops. Doesn't do anything, just hangs on the second image and doesn't go to the third. WHAAATTT?! I can't figure out what I did wrong, anyone see the error?

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html>
	<head>
		<link rel="stylesheet" type="text/css" href="style.css">
		<title>Kal Web Design</title>
		
		<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
		<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
		<script type="text/javascript">
			function Slider() {
				$(".slider #1").show("fade", 500);
				$(".slider #1").delay(5500).hide("slide", {direction:'left'}, 500);
				
				var sc = $(".slider img").size();
				var count = 2;
				
				setInterval(function (){
					$(".slider #"+count).show("slide", {direction:'right'}, 500);
					$(".slider #").delay(5500).hide("slide", {direction:'left'}, 500);
				
					if(count == sc){
						count = 1;
					}else{
						count = count + 1;
					}
				},6500);
			}
		</script>
	</head>
	<body onload="Slider();">
		<div class="nav">
			<ul>
				<li><a href="google.com">About</a></li>
				<li><a href="google.com">Contact</a></li>
				<li><a href="google.com">Services</a></li>
				<li><a href="google.com">Work</a></li>
			</ul>
		</div>
		<div id="logo"><img src="KWDlogo.png" /></div>
		<div class="sliderBG">
			<div class="sliderArea">
				<div class="slider">
					<img id="1" src="test1.png"></img>
					<img id="2" src="test2.png"></img>
					<img id="3" src="test3.png"></img>
				</div>
			</div>
		</div>
	</body>
</html?

Reply With Quote
  #2  
Old December 1st, 2012, 07:03 PM
AndrewSW's Avatar
AndrewSW AndrewSW is offline
JavaScript is not spelt java
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2011
Location: Landan, England
Posts: 743 AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level)AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level)AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level)AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level)AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level)AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level)AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level)AndrewSW User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 22 h 56 m
Reputation Power: 164
<html?

at the end should be corrected.

Code:
$(".slider #").delay(5500).hide("slide", {direction:'left'}, 500);

.. you haven't attached a number to the #.

IDs should, preferably, not just be numbers, but most browsers will accept these.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Frustration with jquery image slider

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap