Solved

Can't get Anything Slider to work locally or remotely even though it's working on jsFiddle

Posted on 2013-01-22
2
520 Views
Last Modified: 2013-01-23
Hi,
I've got this slider on the homepage. I was having problems and got an answer on CSS-tricks.com. My hero got it working in jsFiddle, but when I load the same code, I'm not getting any action on the slider.

Can someone tell me what I'm missing. The fellow at CSS-tricks.com is puzzled as well.
 Site:

http://sandbox.intrepidrealist.com/lucidityfest

Javascript:

http://sandbox.intrepidrealist.com/lucidityfest/wp-content/themes/lucidity-fest/js/jquery.anythingslider.js

http://sandbox.intrepidrealist.com/lucidityfest/wp-content/themes/lucidity-fest/js/jquery.anythingslider.video.js

http://sandbox.intrepidrealist.com/lucidityfest/wp-includes/js/swfobject.js

CSS:
#slider {
	width: 960px;
	height: 445px;
	margin: 0;
	list-style: none;
	/* Prevent FOUC (see FAQ page) and keep things readable if javascript is disabled */
	overflow-y: auto;
	overflow-x: hidden;
}

/******************
  SET STYLING HERE
 ******************
 =================================
 Default state (no keyboard focus)
 ==================================*/
 
 #slides-wrapper {
	position: relative;
	width: 960px;
	height: 445px;
	margin: 0 auto;
	}
	#slides {
		position:absolute;
		top:0;
		left:0;
		width: 960px;
		height: 445px;
		background: #170a04;
		z-index:100;
		}
		
/* Overall Wrapper */
.anythingSlider-default {
	margin: 0 auto;
	/* 45px right & left padding for the arrows, 28px @ bottom for navigation */
	padding: 0 45px 28px 45px;
}
/* slider window - top & bottom borders, default state */
.anythingSlider-default .anythingWindow {
	border-top: 3px solid #777;
	border-bottom: 3px solid #777;
}
/* Navigation buttons + start/stop button, default state */
.anythingSlider-default .anythingControls a {
	/* top shadow */
	background: #777 url(../images/default.png) center -288px repeat-x;
	color: #000;
	border-radius: 0 0 5px 5px;
	-moz-border-radius: 0 0 5px 5px;
	-webkit-border-radius: 0 0 5px 5px;
}
/* Make sure navigation text is visible */
.anythingSlider-default .anythingControls a span {
	visibility: visible;
}
/* Navigation current button, default state */
.anythingSlider-default .anythingControls a.cur {
	background: #888;
	color: #000;
}

/* start-stop button, stopped, default state */
.anythingSlider-default .anythingControls a.start-stop {
	background-color: #040;
	color: #ddd;
}
/* start-stop button, playing, default state */
.anythingSlider-default .anythingControls a.start-stop.playing {
	background-color: #800;
}

/* start-stop button, default hovered text color (when visible) */
/* hide nav/start-stop background image shadow on hover - makes the button appear to come forward */
.anythingSlider-default .anythingControls a.start-stop:hover,
.anythingSlider-default .anythingControls a.start-stop.hover,
.anythingSlider-default .anythingControls a.start-stop .anythingControls ul a:hover {
	background-image: none;
	color: #ddd;
}

/*
 =================================
 Active State (has keyboard focus)
 =================================
*/
/* slider window - top & bottom borders, active state */
.anythingSlider-default.activeSlider .anythingWindow {
	border-color: #7C9127;
}
/* Navigation buttons, active state */
.anythingSlider-default.activeSlider .anythingControls a {
	/* background image = top shadow */
	background-color: #7C9127;
}
/* Navigation current & hovered button, active state */
.anythingSlider-default.activeSlider .anythingControls a.cur,
.anythingSlider-default.activeSlider .anythingControls a:hover {
	/* background image removed */
	background: #7C9127;
}

/* start-stop button, stopped, active state */
.anythingSlider-default.activeSlider .anythingControls a.start-stop {
	background-color: #080;
	color: #fff;
}
/* start-stop button, playing, active state */
.anythingSlider-default.activeSlider .anythingControls a.start-stop.playing {
	background-color: #d00;
	color: #fff;
}
/* start-stop button, active slider hovered text color (when visible) */
.anythingSlider-default.activeSlider .start-stop:hover,
.anythingSlider-default.activeSlider .start-stop.hover {
	color: #fff;
}

/************************
  NAVIGATION POSITIONING
 ************************/
/* Navigation Arrows */
.anythingSlider-default .arrow {
	top: 50%;
	position: absolute;
	display: block;
}

.anythingSlider-default .arrow a {
	display: block;
	width: 45px;
	height: 140px;
	margin: -70px 0 0 0; /* half height of image */
	text-align: center;
	outline: 0;
	background: url(../images/default.png) no-repeat;
}

/* back arrow */
.anythingSlider-default .back { left: 0; }
.anythingSlider-default .back a { background-position: left top; }
.anythingSlider-default .back a:hover,
.anythingSlider-default .back a.hover { background-position: left -140px; }
/* forward arrow */
.anythingSlider-default .forward { right: 0; }
.anythingSlider-default .forward a { background-position: right top; }
.anythingSlider-default .forward a:hover,
.anythingSlider-default .forward a.hover { background-position: right -140px; }

/* Navigation Links */
.anythingSlider-default .anythingControls { outline: 0; display: none; }
.anythingSlider-default .anythingControls ul { margin: 0; padding: 0; float: left; }
.anythingSlider-default .anythingControls ul li { display: inline; }
.anythingSlider-default .anythingControls ul a {
	font: 11px/18px Georgia, Serif;
	display: inline-block;
	text-decoration: none;
	padding: 2px 8px;
	height: 18px;
	margin: 0 5px 0 0;
	text-align: center;
	outline: 0;
}

/* navigationSize window */
.anythingSlider-default .anythingControls .anythingNavWindow {
	overflow: hidden;
	float: left;
}

/* Autoplay Start/Stop button */
.anythingSlider-default .anythingControls .start-stop {
	padding: 2px 5px;
	width: 40px;
	text-align: center;
	text-decoration: none;
	float: right;
	z-index: 100;
	outline: 0;
}

/***********************
  IE8 AND OLDER STYLING
 ***********************/

/* Navigation Arrows */
.as-oldie .anythingSlider-default .arrow {
	top: 30%;
}
.as-oldie .anythingSlider-default .arrow a {
	margin: 0;
}

/* margin between nav buttons just looks better */
.as-oldie .anythingSlider-default .anythingControls li {
	margin-left: 3px;
}

/* When using the navigationSize option, the side margins need to be zero
	None of the navigation panels look good in IE7 now =( */
.as-oldie .anythingSlider-default .anythingControls a {
	margin: 0;
}
.as-oldie .anythingSlider-default .anythingNavWindow {
	margin: 0 2px;
}
.as-oldie .anythingSlider-default .anythingNavWindow li {
	padding: 3px 0 0 0;
}

/***********************
  COMMON SLIDER STYLING
 ***********************/
/* Overall Wrapper */
.anythingSlider {
	display: block;
	overflow: visible !important;
	position: relative;
}
/* anythingSlider viewport window */
.anythingSlider .anythingWindow {
	overflow: hidden;
	position: relative;
	width: 100%;
	height: 100%;
}
/* anythingSlider base (original element) */
.anythingSlider .anythingBase {
	background: transparent;
	list-style: none;
	position: absolute;
	overflow: visible !important;
	top: 0;
	left: 0;
	margin: 0;
	padding: 0;
}

/* Navigation arrow text; indent moved to span inside "a", for IE7;
  apparently, a negative text-indent on an "a" link moves the link as well as the text */
.anythingSlider .arrow span {
	display: block;
	visibility: hidden;
}
/* disabled arrows, hide or reduce opacity: opacity: .5; filter: alpha(opacity=50); */
.anythingSlider .arrow.disabled {
	display: none;
}
/* all panels inside the slider; horizontal mode */
.anythingSlider .panel {
	background: transparent;
	display: block;
	overflow: hidden;
	float: left;
	padding: 0;
	margin: 0;
}
/* vertical mode */
.anythingSlider .vertical .panel {
	float: none;
}
/* fade mode */
.anythingSlider .fade .panel {
	float: none;
	position: absolute;
	top: 0;
	left: 0;
	z-index: 0;
}
/* fade mode active page - visible & on top */
.anythingSlider .fade .activePage {
	z-index: 1;
}

/***********************
  RTL STYLING
 ***********************/
/* slider autoplay right-to-left, reverse order of nav links to look better */
.anythingSlider.rtl .anythingWindow {
	direction: ltr;
	unicode-bidi: bidi-override;
}
.anythingSlider.rtl .anythingControls ul { float: left; } /* move nav link group to left */
.anythingSlider.rtl .anythingControls ul a { float: right; } /* reverse order of nav links */
.anythingSlider.rtl .start-stop { /* float: right; */ } /* move start/stop button - in case you want to switch sides */

/* probably not necessary, but added just in case */
.anythingSlider,
.anythingSlider .anythingWindow,
.anythingSlider .anythingControls ul a,
.anythingSlider .arrow a,
.anythingSlider .start-stop {
	transition-duration: 0;
	-o-transition-duration: 0;
	-moz-transition-duration: 0;
	-webkit-transition-duration: 0;
}

Open in new window

0
Comment
Question by:Alicia St Rose
2 Comments
 
LVL 42

Accepted Solution

by:
David S. earned 500 total points
ID: 38808366
It seems that the code in jsFiddle is missing the doctype, so the page is running in quirks mode. As a result, a certain JavaScript error is being silently corrected (an ID is being used as a global variable).

Change
				      buildComplete: function() {
				        splash.find('li.slide-closed div').css('display', 'none');
				        splash.find('li.slide-open div').fadeIn();
				      },

Open in new window

to
				      buildComplete: function() {
				        var splash=$('#splash');
				        splash.find('li.slide-closed div').css('display', 'none');
				        splash.find('li.slide-open div').fadeIn();
				      },

Open in new window

0
 
LVL 7

Author Closing Comment

by:Alicia St Rose
ID: 38810761
Woot Woot!!!
This worked. I had to change the $ to jQuery for no conflict. My slider is working!
You, sir, rock once again!

Thank you!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now