Jump to content

MouseOver image change


Vivid Lust

Recommended Posts

Could someone please tell me what code I would need to make a hover over effect on " this.imagefiles[0]", thanks.

 

Code:

 

var dhtmlwindow={
imagefiles:['windowfiles/min.gif', 'windowfiles/cross.gif', 'windowfiles/restore.gif', 'windowfiles/resize.gif'], //Path to 4 images used by script, in that order
ajaxbustcache: true, //Bust caching when fetching a file via Ajax?
ajaxloadinghtml: '<b>Loading Page. Please wait...</b>', //HTML to show while window fetches Ajax Content?

minimizeorder: 0,
zIndexvalue:100,
tobjects: [], //object to contain references to dhtml window divs, for cleanup purposes
lastactivet: {}, //reference to last active DHTML window


init:function(t){
var domwindow=document.createElement("div") //create dhtml window div
domwindow.id=t
domwindow.className="dhtmlwindow"
var domwindowdata=''
domwindowdata=' <div class="drag-handle">'
domwindowdata+='<div class="drag-stripes"><div class="drag-handle2">DHTML Window</div><div class="drag-controls"><img src="'+this.imagefiles[0]+'"  title="Minimize" /><img src="'+this.imagefiles[1]+'" title="Close" /></div></div>'
domwindowdata+='</div>'
domwindowdata+='<div class="drag-container" ><div id="cell1" class="drag-contentarea"></div>'
domwindowdata+='<div class="drag-statusarea"><div  class="drag-resizearea" style="background: transparent url('+this.imagefiles[3]+') top right no-repeat;"> </div></div>'
domwindowdata+='</div></div>'

Link to comment
https://forums.phpfreaks.com/topic/145416-mouseover-image-change/
Share on other sites

You could create a simple function to change the source of the image...

 

function changeImg(obj, url) {
    if (obj.src) {
        obj.src = url;
    }
    return;
}

 

Then call it with onmouseover="changeImg(this, 'rollover3.gif');" ..

 

Adam

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.