By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,677 Members | 1,882 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,677 IT Pros & Developers. It's quick & easy.

sliding bar problem

P: n/a
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
http://www.rajk.uni-corvinus.hu/~nag...index/koltozes

Thx, Viktor

Apr 22 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
ASM
Viktor a écrit :
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.


have a look here:
http://ygda.free.fr/hscroll2.htm
http://ygda.free.fr/hscroll3.htm
if explain needed -> in french here :
http://ygda.free.fr/hscrollScript.htm

--
Stephane Moriaux et son [moins] vieux Mac
Apr 22 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.