Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-28-2011, 09:41 PM   PM User | #1
rubbershark
New to the CF scene

 
Join Date: Sep 2011
Posts: 1
Thanks: 1
Thanked 0 Times in 0 Posts
rubbershark is an unknown quantity at this point
How do I get my banner to automatically rotate please?

Hi guys, I have a home page banner which I'd like to automatically rotate. At the moment you can only change the image by clicking the tabs under the image. Here's the URL:

http://www.anchorhotelhaydonbridge.com/newsite

& here's my JS code:

$(document).ready(function() {

$(function() {$('#tabs_news').tabs({ fxFade: true, fxSpeed: 'fast' });});

$("ul.sf-menu").superfish({
autoArrows: false,
delay: 400, // one second delay on mouseout
animation: {opacity:'show',height:'show'}, // fade-in and slide-down animation
speed: 'fast', // faster animation speed
autoArrows: false, // disable generation of arrow mark-up
dropShadows: false // disable drop shadows
});

$('ul.list li').each(function() {
var a = $(this).children('a');
var aClass = a.attr('rel');
if (a.hasClass('active')) {
$('.'+aClass).css({'display':'block'});
} else {
$('.'+aClass).css({'display':'none'});
}
});
$('ul.list li a').click(function () {
var thisaClass = $(this).attr('rel');
$(this).parent('li').parent('ul').children('li').each(function() {
var a = $(this).children('a');
var aClass = a.attr('rel');
if (thisaClass == aClass) {
$('.'+aClass).show();
a.attr('class','active');
} else {
$('.'+aClass).hide();
a.attr('class','');
}
});
return false;
});

// wrap 'span' to nav page link
$('.topnav ul').children('li').each(function() {
$(this).children('a').html('<span>'+$(this).children('a').text()+'</span>'); // add tags span to a href
});





});
rubbershark is offline   Reply With Quote
Old 09-28-2011, 09:42 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,751
Thanks: 4
Thanked 2,468 Times in 2,437 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Despite the similar sounding names, Java is not the same as Javascript.
Moving from Java forum to Javascript framework forum.
Fou-Lu is offline   Reply With Quote
Users who have thanked Fou-Lu for this post:
rubbershark (09-28-2011)
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:04 PM.


Advertisement
Log in to turn off these ads.