Jump to content

[SOLVED] modify script help needed (image scroller)


isaac_cm

Recommended Posts

Hello,

 

here is the script I used from this site

http://www.dynamicdrive.com/dynamicindex4/cmotiongallery.htm

 

the problem with this one it did not fit in my design, I need the scroll fixed and only take action when I point to the far left or right image

 

any idea ?

 

thanks

 

I have redone that thing using mootools. It gives cleaner codes and is easier to modify

 

what's needed in your head section

<script src="mootools.v1.11.js"></script>
<style>


#mousemove{
width: 500px;
height: 358px;
border: 1px solid #000;
overflow-x: hidden;
overflow-y: hidden;
margin: 0 auto;
}



.inside {
width: 2450px;
height: 358px;
}


.scroll_image{
padding-left:0px;
margin-left:0px;
margin-right:0px;
padding-right:0px;
border:0px;

float:left;
height: 358px;
width: 400px;
}

</style>

the slider itself

<div id="mousemove">
<div class="inside">
	<img class="scroll_image" src="http://www.onlinecooking.net/news/NewsImages/chicken.JPG" />
	<img class="scroll_image" src="http://www.onlinecooking.net/news/NewsImages/chicken.JPG" />
	<img class="scroll_image" src="http://www.onlinecooking.net/news/NewsImages/chicken.JPG" />
	<img class="scroll_image" src="http://www.onlinecooking.net/news/NewsImages/chicken.JPG" />
	<img class="scroll_image" src="http://www.onlinecooking.net/news/NewsImages/chicken.JPG" />
	<img class="scroll_image" src="http://www.onlinecooking.net/news/NewsImages/chicken.JPG" />
</div>
</div>
<script>

var scroll1 = new Scroller('mousemove', {area: 100, velocity: 1});

// Mousemove
$('mousemove').addEvent('mouseenter', scroll1.start.bind(scroll1));
$('mousemove').addEvent('mouseleave', scroll1.stop.bind(scroll1));
</script>

Mootools is a javascript framework that makes javascripting a hell lot easier and especially when it's about graphical user interfaces. It's similar to prototype but better. check out the website and check the demos and the documentation about mootools to learn more http://mootools.net/

  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.