Vivid Lust Posted February 16, 2009 Share Posted February 16, 2009 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>' Quote Link to comment https://forums.phpfreaks.com/topic/145416-mouseover-image-change/ Share on other sites More sharing options...
Adam Posted February 16, 2009 Share Posted February 16, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/145416-mouseover-image-change/#findComment-763382 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.