sliding bar problem

V

Viktor

Hello,

I started to rewrite the lightbox code for a different layout. The main
advantage would be to have a sliding image bar, but I can not get the
sliding motion.

The html code:
<div id="slidebar">
<div id="images-wrapper">
<div id="images">
<a href="img.jpg" title="No title" rel="showcase"><img
src="img.jpg" /></a>
<a href="img.jpg" title="No title" rel="showcase"><img
src="img.jpg" /></a>
<a href="img.jpg" title="No title" rel="showcase"><img
src="img.jpg" /></a>
</div>
</div>
</div>

With the script I change the layout of #images to have only one row,
add the navigation arrows and on onmouseover effect for these arrows:

slidebar = $('slidebar');
Element.hide('slidebar'); // To prevent flickering

Element.setWidth('images',10000);
images = $('images-wrapper');
images.style.overflow = 'hidden';

/*********************************************
Here comes the main part
*********************************************/

var prevArrow = document.createElement('img');
prevArrow.setAttribute('id','prevArrow');
prevArrow.src = prevImage;
prevArrow.className = 'showcaseArrow';
prevArrow.onmouseover =function(){ new Effect.moveBy('images',0,20);
};
slidebar.appendChild(prevArrow);

var nextArrow = document.createElement('img');
nextArrow.setAttribute('id','nextArrow');
nextArrow.src = nextImage;
nextArrow.className = 'showcaseArrow';
nextArrow.onmouseover = function() { new
Effect.moveBy('images',0,-20)};
slidebar.appendChild(nextArrow);

Element.show('slidebar');

If I try this code, then I get an error for the onmouseover:
Effect.moveBy is not a constructor

Any ideas?

You can see this script in work at
www.rajk.uni-corvinus.hu/~nagyv/index.php/fenykepek/index/koltozes

Thx, Viktor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top