473,609 Members | 1,874 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

rollover triggers rotation

I am looking for ideas on how to create a rollover that triggers an
image rotation in another location. I know how to create a function
for basic rollovers, image swapping sort of thing, but I know know how
to create the rotation.

This is what the client wants...
....create a circle of images, each of which will trigger an image
rotation in the center of this circle until the mouseout.

Yea, I'm a little green with js.

Thanks.

May 10 '06 #1
2 2102
ASM
the other john a écrit :
I am looking for ideas on how to create a rollover that triggers an
image rotation in another location. I know how to create a function
for basic rollovers, image swapping sort of thing, but I know know how
to create the rotation.

This is what the client wants...
...create a circle of images, each of which will trigger an image
rotation in the center of this circle until the mouseout.


all images same size
8 (or 6, or 10) images around central one.

<script type="text/javascript">
var what=0;
var imgNext, picts;
onload = function() {
picts = document.getEle mentById('myPic ts');
picts = picts.getElemen tsByTagName('IM G');
}
function rotate(what,tim er) {
if(what == (picts.length/2)) what == (picts.length/2)+1;
if(what == picts.length) what = 0;
picts[picts.length/2].src = picts[what].src;
what++;
imgNext = setTimeout('rot ate('+what+';'+ timer+')',timer );
}
</script>
<div id="myPicts">
<img src="img1.jpg"> <img src="img2.jpg"> <img src="img3.jpg"> <br>
<img src="img4.jpg">
<img src="img0.jpg"
onmouseover="ro tate(0,800)"
onmouseover="cl earTimeout(imgN ext);">
<img src="img5.jpg"> <br>
<img src="img6.jpg"> <img src="img7.jpg"> <img src="img8.jpg">
</div>
or

<script type="text/javascript">
var what=0;
var imgNext, p, picts;
function collectImages() {
p = document.getEle mentById('myPic ts');
p = p.getElementsBy TagName('IMG');
picts = new Array();
for(var i=0;i<p.length; i++) {
picts[i] = new Image();
picts[i].src = p.src;
}
}
onload = collectImages;
function rotate(what,tim er) {
if(what == picts.length) what = 0;
p[p.length/2].src = picts[what].src;
what++;
imgNext = setTimeout('rot ate('+what+';'+ timer+')',timer );
}
</script>
<div id="myPicts">
<img src="img1.jpg"> <img src="img2.jpg"> <img src="img3.jpg"> <br>
<img src="img4.jpg">
<img src="img0.jpg"
onmouseover="ro tate(0,800)"
onmouseover="cl earTimeout(imgN ext);">
<img src="img5.jpg"> <br>
<img src="img6.jpg"> <img src="img7.jpg"> <img src="img8.jpg">
</div>
--
Stephane Moriaux et son [moins] vieux Mac
May 10 '06 #2
thanks. now that I can see what you're doing here (takes me time to
figure it out) I can say this isn't exactly what I meant..that is,
there is more than I indicated.

The circle of images is a collection of thumbs. Each thumb represents
a specific product. when the user mousesover each thumb the resulting
"slide show"(lack of better term) rotates example images of for that
product. these rotating images would need to be preloaded but do "not"
appear on the page already. If I'm understanding what you did here
this will create a slide show of this images already present in the
circle of thumbs, correct?

Thanks for the response, it's helps a lot!

May 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
3822
by: M. Clift | last post by:
Hi All, Could someone help me out with this? items = ('a', 'b', 'c', 'd') items + 1 = ( 'b', 'c', 'd', 'a') items + 2 = ( 'c', 'd', 'a', 'b') items + 3 = ( 'd', 'a', 'b', 'c') trans = 1
47
7593
by: Lauren Quantrell | last post by:
I have constructed the following code that simulates the common rollover effect when moving the mouse over a label (this example makes the label bold.) I'm wondering if anyone has come up with a better solution. lq 'start code:
3
2293
by: Mark Szlazak | last post by:
The following page simulates a pool cue and cue ball: http://members.aol.com/myscript/cue.html Mouse cursor position around the cue ball determines where a roll-over of 179 pool cue images is placed around the ball and which one of those images is displayed. Each pool cue image is in a slightly different orientation and the correct one is chosen to match the orientation of the cursor around the ball. Holding down the left mouse button...
5
3500
by: Russell Warren | last post by:
Does anyone have an easier/faster/better way of popping from the middle of a deque than this? class mydeque(deque): def popmiddle(self, pos): self.rotate(-pos) ret = self.popleft() self.rotate(pos) return ret
3
1465
by: Rob R. Ainscough | last post by:
Just curious why a VERY commonly used affect of rollover was NOT implemented in .NET 2.0 for web controls? Does anyone have a link to VB code that will show me how to build my own UserControl that will support a rollover? thanks, Rob.
0
1788
by: VorTechS | last post by:
I'm having a problem with an inherited label, applying text rotation to aligned text. If text rotation is applied to the aligned text, the alignment goes 'nuts'. I can find no logic to what is happening. I've built the following code from several examples on the web, if you remove the rotation then alignment works fine: Imports System.ComponentModel
2
3816
by: Roger Li | last post by:
I got a problem about the mean rotation calculation. I have a group of rotation matrics in my program and I want to calculate the mean rotation on the basis of these rotation matrics. I think it is a general mathmatical problem. So I wanna know where I can find the code or math lib written in C++.
3
2726
by: Oriane | last post by:
Hi there, I would like to handle a "rollover" <asp:Buttonin the code behind with C# with this kind of code: Button btn = Page.FindControl("Button" + numWidget) as Button; btn.Attributes = "document.all." + btn.ClientID + ".src = '/Images/blue.gif'";
0
8139
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8091
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8579
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8555
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8232
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6064
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1686
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1403
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.