# jQuery: Linking to objects by array

**URL:** <https://forum.kirupa.com/t/jquery-linking-to-objects-by-array/321227>\
**Category:** web dev\
**Created:** [April 13, 2011, 5:59pm UTC](https://forum.kirupa.com/t/jquery-linking-to-objects-by-array/321227 "2011-04-13T17:59:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spyderfx](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@spyderfx](https://forum.kirupa.com/u/spyderfx)\
**Post date:** [April 13, 2011, 5:59pm UTC](https://forum.kirupa.com/t/jquery-linking-to-objects-by-array/321227/1 "2011-04-13T17:59:22Z")

</div>

I am trying to make a jQuery banner that will set a certain image as active when you hover over the thumbnail for that image. This is the code I’m trying to use atm

```auto
var $banners = $('#banner a');
var $buttons = $('#banner_buttons li>a');

$buttons.hover(
	function() {
		if($buttons.children().index() == $banners.children().index())
			$banners.addClass('active');
	});

```

I’m trying to sort of link the thumbnail with the image so whenever there is a hover state for a thumbnail, the complimentary image is active, but also the images will be rotating on a timer, so whenever the image is active, the thumbnail should be active too.

That was a really convoluted explanation so I’ll just link to an example.

Like this banner: [http://www.belkin.com/](http://www.belkin.com/)
