...

View Full Version : Fade buttons stop nivoslider working



beelzebomb
12-15-2011, 11:02 AM
Hi, I reckon this is pretty simple for u guys but I'm new to jquery code.

Adding the code for the fade buttons breaks the nivoslider - any ideas?

(All the below in header - jquery-1.3.2.min.js is a file on my machine)


<link href="style.css" rel="stylesheet" type="text/css" />

/* this below is nivoslider code */

<link rel="stylesheet" href="nivoslider/nivoslider/nivo-slider.css" type="text/css" media="screen" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script src="nivoslider/nivoslider/jquery.nivo.slider.js" type="text/javascript"></script>
<script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider();
});
</script>

/* this below is fade button code - */

<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.static,.home,.products,.ordering,.contact').append('<span class="hover"></span>').each(function () {
var $span = $('> span.hover', this).css('opacity', 0);
$(this).hover(function () {
$span.stop().fadeTo(500, 1);
}, function () {
$span.stop().fadeTo(500, 0);
});
});
});
</script>
</head>

beelzebomb
12-15-2011, 11:05 AM
Simply placing the fade code above the standard stylesheet link fixed it - would be curious to know why though!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum