473,545 Members | 1,638 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

double mouseover or function

Why does this not work:

function flipon(){
if (!this.filters. flipH) this.style.filt er = 'flipH';
this.filters.fl ipH.enabled = true;
function flipoff(){
this.filters.fl ipH.enabled = false;

with this:

<IMG SRC="../graphics/romoy/bad.jpg" width=350 height=233 alt=""
border="0" onmouseover="fl ipon()" onmouseout ="flipoff()" >

This is ok:

<IMG SRC="../graphics/romoy/bad.jpg" width=350 height=233 alt=""
border="0" onmouseover="if (!this.filters. flipH) this.style.filt er =
'flipH'; this.filters.fl ipH.enabled = true;" onmouseout
="this.filters. flipH.enabled = false;">

I would like to put it in a function to use it here too:
Or how can I put two mouseovers in this:

<area shape="rect" alt="" coords="45,100, 78,123"
onMouseOver="ph oto.src='../graphics/romoy/bad.jpg'; return true;">


find clausen
Jul 20 '05 #1
1 2326
find clausen said:

Why does this not work:

function flipon(){
if (!this.filters. flipH) this.style.filt er = 'flipH';
this.filters.f lipH.enabled = true;
function flipoff(){
this.filters.f lipH.enabled = false;

with this:

<IMG SRC="../graphics/romoy/bad.jpg" width=350 height=233 alt=""
border="0" onmouseover="fl ipon()" onmouseout ="flipoff()" >

Because "this" doesn't refer to the image except in the
event handler function. Your event handler needs to pass
that reference on to the functions that they call:

function flipon(thisImag e){
if (!thisImage.fil ters.flipH) thisImage.style .filter = 'flipH';
thisImage.filte rs.flipH.enable d = true;
function flipoff(thisIma ge){
thisImage.filte rs.flipH.enable d = false;

with this:

<IMG SRC="../graphics/romoy/bad.jpg" width=350 height=233 alt=""
border="0" onmouseover="fl ipon(this)" onmouseout ="flipoff(this) ">

Jul 20 '05 #2

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

Similar topics

by: Les Juby | last post by:
A client needs a routine to alert him as to which memo records in an Access-2000 database have had double apostrophes inserted in the text. These are stopping a Java mouseover from executing. Normally, while cycling through the recordset, I would use the InStr function to test for a positive result indicating and embedded text. ie. If...
by: richk | last post by:
For some reason when I add additional buttons a 3rd button and beyond i cant get the effect to work and I get errors...I cant understand why... <SCRIPT LANGUAGE = "javascript"><!-- if (document.images) { // Active Images img1on = new Image(); img1on.src = "button1_on.jpg";
by: J. Makela | last post by:
Hallo. This should be a pretty entertaining question for you *real* javascript writers.. I, being the lowly photoshop guy at an ad agency made the mistake of actually saying "HTML" in a conversation once.. and now I have been tasked with building a big website with LOTS of fancy javascripting. Image rollovers mostly. Only problem is that I...
by: Kim | last post by:
Hi I'm trying to do something like this. for(i=0; i<5; i++){ var theData = document.createElement('a'); theData.onmouseover = function() { return get(i);} ... ... }
by: Alex | last post by:
On my page I have a lot string like this: <span onmouseover="callMe(this)" onmouseout="callMe(null)" >abc1</span> <span onmouseover="callMe(this)" onmouseout="callMe(null)" >abc2</span> <span onmouseover="callMe(this)" onmouseout="callMe(null)" >abc3</span> <span onmouseover="callMe(this)" onmouseout="callMe(null)" >abc4</span> How can I...
by: JB | last post by:
I am struggling to figure out a way to allow one element to be dragged, but still capture 'mouseover' events on other elements. I've created a simple example to demonstrate what I mean: http://gerromorpha.cs.uoregon.edu/moveAndOver.html (The above link is only meant for Windows/Firefox.) It's not much code, but it's probably too much to...
by: giloosh | last post by:
Hello All, How can you continue the mouseover event while the mouse is still over an object? For example: I put my mouse over a hyperlink and that triggers an object to move 10px to the right. I want the object to continue moving 10px to the right every 1 second untill i take my mouse off of the hyperlink.
by: markszlazak | last post by:
I'm a relatively slow response of table cells changing their background color with mouseover/our in IE6 (Win 2K) but the response is fine (fast) in Firefox. Why? The code is below. Sorry about the length. <html> <head> <title>Rapid Blocking Interface</title> <style> .calendar {
by: markszlazak | last post by:
Could someone check out the following code and please help me understand the problem and fix it. It seems like some events are not firing when my mouse moves over the table cells to quickly causing some table cells to stay yellow when you move out of them instead of going back to blue. (Note that I'm using DIV's inside this table because...
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...
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...
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. ...
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...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
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...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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

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.