页面加载时自动旋转图像 [英] rotate images automatically when page loads

查看:81
本文介绍了页面加载时自动旋转图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有旋转图像的javascript代码,但只有当鼠标放在图像上时才会开始旋转。但我想在页面加载时自动旋转图像。在这方面可以指导我吗?


旋转图像的javscript是:


mg src ="''+ mImages [this.a3] .src +''" ;的onmouseover = QUOT; this.src = \ + mImagesO [this.a3]的.src + \"的onmouseout = QUOT; this.src = \ + mImages [this.a3]的.src + \" border = 0 id =" img''+ this.a3 +''" style =" cursor:pointer


我想用任何其他事件替换onmouseover和onmouseout事件,这有助于我在页面加载时自动旋转图像。

请在这方面帮助我。提前谢谢。

Hi,
I have javascript code for rotating images, but the rotation starts only when mouse is placed over the image. But i want to rotate images automatically when the page loads. Can any guide me in this regard.

the javscript for rotating images is :

mg src="''+mImages[this.a3].src+''" onmouseover="this.src=\''''+mImagesO[this.a3].src+''\''" onmouseout="this.src=\''''+mImages[this.a3].src+''\''" border=0 id="img''+this.a3+''" style="cursor:pointer

I want to replace onmouseover and onmouseout event by any other event which helps me in rotating images automatically when th page loads.

please help me in this regard. thank you in advance.

推荐答案

您的发布代码似乎直接写入图像节点。只需将其写入一个javascript函数,即检索您需要的图像并调用页面的onload...


亲切的问候
it seems that your posted code is directly written to an image node. just write it into a javascript-function that retrieves the images you need and call that ''onload'' of your page ...

kind regards


Hi Gits,


感谢您的回复。其实我是javascript的新手。您可以在以下js文件中进行更改,以便在页面加载时自动旋转图像:

Hi Gits,

thank for your response. Actually I am new in javascript. Can u please make changes in following js file, in order to make the images rotate automatically when page loads:

展开 | < span class =codeLinkonclick =selectAll(this);>选择 | Wrap | 行号


你的第一篇文章显示了一种非常不同的旋转方式...只需在鼠标悬停时替换图像...为什么现在使用另一个脚本?这会做一些更复杂的事情,我真的不喜欢阅读那一堆代码来理解它只是为了一个简单的事情,图像替换将是。你是否只需要更换的图像,或者甚至需要你最后显示的脚本中的所有内容 - 甚至还需要文本,字体等等...图像是否应该旋转? ...首先描述你的要求并给出一个示例html因此我们可以一起解决这个问题......这将有助于你理解事情是如何工作的,而不仅仅是复制和粘贴脚本......


亲切的问候
your first post shows a very different way to ''rotate'' ... by just replacing the images on mouseover ... why do you use another script now? this does some more complex things and i don''t really like to read that bunch of code to understand it just for such a simple thing that the image-replace would be. do you just need replaced images or do you even need all of the things in your last shown script - that even does something with text, fontsize etc. ... should the images keep rotating? ... just describe your requirement first and give an example html for it so we could work that out together ... that will help you to understand how things would work instead of just copy&paste scripts ...

kind regards


这篇关于页面加载时自动旋转图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆